Skip to content

adding in readonly annotations to support M365 federated connections - #3799

Open
chrisolver wants to merge 1 commit into
Azure:mainfrom
chrisolver:co-readonly-annotations
Open

adding in readonly annotations to support M365 federated connections#3799
chrisolver wants to merge 1 commit into
Azure:mainfrom
chrisolver:co-readonly-annotations

Conversation

@chrisolver

@chrisolver chrisolver commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Adds read-only annotations to the MCP aggregate records tool so it is correctly advertised as a non-mutating operation for M365 federated connections. Solving #3798

What changed

  • Updated AggregateRecordsTool to include ToolAnnotations
  • Set ReadOnlyHint = true on the tool definition

Why

This helps the MCP tool metadata reflect that the aggregate records operation is read-only, which is important for M365 federated connection support and for consumers that rely on tool annotations to understand operation safety.

Impact

  • No functional query behavior change
  • Improves tool metadata and compatibility
  • Helps downstream clients and orchestration layers treat the tool as non-mutating

Files changed

  • src/Azure.DataApiBuilder.Mcp/BuiltInTools/AggregateRecordsTool.cs
  • src/Azure.DataApiBuilder.Mcp/BuiltInTools/DescribeEntitiesTool.cs‎
  • src/Azure.DataApiBuilder.Mcp/BuiltInTools/ReadRecordsTool.cs

Notes

This is a small metadata-only change with low risk.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@chrisolver

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are limited to tool metadata annotations, are consistent across the updated tools, and do not affect execution logic.

Pull request overview

This pull request updates MCP built-in tool metadata to mark read-only operations with ToolAnnotations.ReadOnlyHint = true, improving downstream interoperability (notably M365 federated connections) by clearly advertising that these tools are non-mutating.

Changes:

  • Added Annotations = new ToolAnnotations { ReadOnlyHint = true } to ReadRecordsTool tool metadata.
  • Added Annotations = new ToolAnnotations { ReadOnlyHint = true } to DescribeEntitiesTool tool metadata.
  • Added Annotations = new ToolAnnotations { ReadOnlyHint = true } to AggregateRecordsTool tool metadata (cached metadata instance).
File summaries
File Description
src/Azure.DataApiBuilder.Mcp/BuiltInTools/ReadRecordsTool.cs Marks the read_records MCP tool as read-only via tool annotations.
src/Azure.DataApiBuilder.Mcp/BuiltInTools/DescribeEntitiesTool.cs Marks the describe_entities MCP tool as read-only via tool annotations.
src/Azure.DataApiBuilder.Mcp/BuiltInTools/AggregateRecordsTool.cs Marks the aggregate_records MCP tool as read-only via tool annotations on the cached metadata object.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants