Add headers field to McpTool spec#85
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/microsoft/AgentSchema/sessions/095e41fa-5a42-427b-9493-fef1eee16bb4 Co-authored-by: sethjuarez <115409+sethjuarez@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add headers to McpTool spec
Add Apr 3, 2026
headers field to McpTool spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MCP tools had no way to specify custom HTTP headers in declarative YAML agent definitions, blocking use cases like per-request auth tokens or routing headers.
Changes
agentschema-emitter/lib/model/tools/mcp.tsp— Addsheaders?: Record<string>toMcpTool, allowing arbitrary string key-value HTTP headersagentschema-emitter/src/ast.ts— Extends theRecord<unknown>dictionary detection to also handleRecord<string>, preventing the emitter from generating an invalid standalone class for itIDictionary<string, object>?(C#),Optional[dict[str, Any]](Python),Record<string, unknown> | undefined(TypeScript),map[string]interface{}(Go)RecordString.yamlschema (string-valued record) referenced fromMcpTool.yamlUsage