Skip to content

Clarify McpMetaAttribute documentation scope#1242

Merged
stephentoub merged 2 commits intomainfrom
copilot/update-mcpmetaattribute-docs
Feb 3, 2026
Merged

Clarify McpMetaAttribute documentation scope#1242
stephentoub merged 2 commits intomainfrom
copilot/update-mcpmetaattribute-docs

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

McpMetaAttribute documentation was unclear about which MCP operations include the specified metadata. Per discussions in #1228 and #1230, clarify that metadata appears only in listing operations, not invocation results.

Changes

  • Updated XML docs to explicitly state metadata populates Tool.Meta, Prompt.Meta, Resource.Meta for listing operations (tools/list, prompts/list, resources/list)
  • Added clarification that metadata is not propagated to invocation results (tools/call, prompts/get, resources/read)
  • Documented how to include metadata in invocation results (set Meta directly on result types)

Example

To include metadata in a tool call result, return CallToolResult with Meta set directly:

[McpServerTool]
[McpMeta("version", "1.0")]  // Only appears in tools/list
public CallToolResult MyTool(string input)
{
    return new CallToolResult
    {
        Content = [new TextContentBlock { Text = "result" }],
        Meta = new JsonObject { ["version"] = "1.0" }  // Appears in tools/call
    };
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…pplication

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot AI changed the title [WIP] Tweak documentation for McpMetaAttribute clarity Clarify McpMetaAttribute documentation scope Feb 3, 2026
Copilot AI requested a review from stephentoub February 3, 2026 18:07
@stephentoub stephentoub marked this pull request as ready for review February 3, 2026 18:09
@stephentoub stephentoub enabled auto-merge (squash) February 3, 2026 18:09
@stephentoub stephentoub merged commit cfa89a3 into main Feb 3, 2026
10 checks passed
@stephentoub stephentoub deleted the copilot/update-mcpmetaattribute-docs branch February 3, 2026 23:51
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