Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SEP-1862: Tool Resolution#1862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SamMorrowDrums wants to merge10 commits intomodelcontextprotocol:main
base:main
Choose a base branch
Loading
fromSamMorrowDrums:sep-dynamic-tool-annotations

Conversation

@SamMorrowDrums
Copy link
Contributor

@SamMorrowDrumsSamMorrowDrums commentedNov 21, 2025
edited
Loading

Summary

This SEP proposes atool resolution mechanism that enables servers to provide argument-specific metadata before tool invocation. The design takes inspiration from LSP's resolve pattern and HTTP preflight OPTION requests while adapting it for MCP's unique requirements.

Key Changes

  • Newtools/resolve method: Clients can request refined tool metadata based on intended arguments
  • Newresolve field: Tools can indicate they support resolution
  • New server capability:tools.resolve: true

The Problem

Tool definitions fromtools/list are static. Amanage_files tool must declaredestructiveHint: true even thoughread operations are completely safe. This causes:

  • Over-prompting with unnecessary confirmation dialogs
  • Reduced trust from LLMs that avoid "destructive" tools
  • Poor UX for versatile, multi-action tools

The Solution

Before invoking a tool, clients can calltools/resolve with the tool name and intended arguments. The server returns a complete tool definition with annotations refined for that specific operation:

// Request{"method":"tools/resolve","params": {"name":"manage_files","arguments": {"action":"read" }}}// Response - safe operation!{"tool": {"name":"manage_files","annotations": {"readOnlyHint":true,"destructiveHint":false }}}

Why This Approach?

This design follows@findleyr'ssuggestion to adopt an LSP-inspired resolve pattern:

"we probably want to avoid a future where there are a bunch of separate preflight checks for a single tool call--it would be better to consolidate them into a single exchange"

By returning the fullTool object, we:

  1. Prevent method proliferation (tools/annotations,tools/scopes,tools/costs)
  2. Enable future extensions without protocol changes
  3. Provide a single preflight exchange for all metadata needs

Future Extensibility

The pattern supports future metadata beyond annotations:

  • Scope requirements: OAuth scopes needed for specific operations
  • Cost estimates: Token/credit costs that vary by arguments
  • Rate limits: Different operations may have different limits

These are explicitly out of scope for this SEP but the mechanism supports them.

Backward Compatibility

Fully backward compatible:

  • Existing servers work unchanged
  • Existing clients can ignoreresolve: true
  • Static annotations remain the fallback

Checklist:

  • SEP follows the template format
  • Abstract and motivation are clear
  • Specification is complete with request/response formats
  • Backward compatibility addressed
  • Security implications considered
  • Reference implementations provided

IrynaKulakova, He-Pin, connor4312, mrjf, and toby reacted with thumbs up emoji
@SamMorrowDrumsSamMorrowDrums marked this pull request as ready for reviewNovember 21, 2025 13:34
@dsp-antdsp-ant changed the titleSEP: Dynamic Tool AnnotationsSEP-1862: Dynamic Tool AnnotationsNov 21, 2025
@dsp-antdsp-ant added proposalSEP proposal without a sponsor. SEP labelsNov 21, 2025
@SamMorrowDrums
Copy link
ContributorAuthor

SamMorrowDrums commentedNov 21, 2025
edited
Loading

Coincidentally there may already be a case for a preflight request for other purposes. As@findleyrmentioned on Discord, we might not be able to support forwarding of 403 errors during tool calls due toSEP-1699 and so we might wish to enable a preflight checks to supportscope challenges also.

cc@dend

@findleyr
Copy link
Contributor

findleyr commentedNov 24, 2025
edited
Loading

By comparison, LSP has a notion of 'resolve', which is when the client asks the server to 'finish filling out' a particular stub. For examplecodeAction/resolve, though this exists for many constructs.

That's slightly different, because the client isn't passing in any specific arguments in the resolve request: it's simply exchanging the stub for a fully filled-out version, but I think there's something to be learned from the design: we probably want to avoid a future where there are a bunch of separate preflight checks for a single tool call--it would be better to consolidate them into a single exchange. I'm not sure what that means, concretely: do we return the entire tool from the preflight check, rather than just its annotations?

SamMorrowDrums reacted with heart emoji

- Update creation date to 2025-11-21- Consolidate duplicate file/API examples into single table-based example- Remove redundant 'Why Return Full Tool?' section (already in Rationale)- Clean up TypeScript comments- Apply prettier formatting
@SamMorrowDrums
Copy link
ContributorAuthor

Revised Direction

Thanks@findleyr for the excellent feedback on adopting an LSP-inspired resolve pattern. I've substantially revised this SEP based on your suggestions and additional considerations around extensibility.

Key Changes

Renamed concept:tools/annotationstools/resolve

  • Field:dynamicAnnotationsresolve
  • Capability:dynamicAnnotationsresolve
  • Method:tools/annotationstools/resolve

Returns full Tool object instead of just annotations

  • Enables future extensions (scopes, costs, rate limits) without new preflight methods
  • Follows the principle of "consolidate into a single exchange"
  • Maintains structural consistency withtools/list responses

Added LSP context with comparison table

  • Clarified that we'readapting LSP's useful patterns for MCP
  • Key difference: MCP tools are fully functional fromtools/list, resolution refines metadata based on intended arguments

Added Future Extensibility section

  • Discussed potential uses for scope requirements (addressingmy comment about scope challenges)
  • Noted these are out of scope but the mechanism supports them

Cleaned up examples

  • Consolidated duplicate file examples
  • Removed redundant sections

Open for Discussion

I'd appreciate feedback on:

  1. The naming (resolve vs alternatives)
  2. Whether the LSP comparison is helpful or distracting
  3. The scope of "future extensibility" - should we be more or less specific?

The goal is a clean, extensible foundation that avoids the "proliferation of preflight methods" concern@findleyr raised.

@SamMorrowDrumsSamMorrowDrums changed the titleSEP-1862: Dynamic Tool AnnotationsSEP: Tool ResolutionNov 25, 2025
…eristics, and related SEPs- Add authorization delegation context example (based on SEP-214 token exchange)- Add execution characteristics example for long-running task indication- Update motivation to mention execution characteristics and auth boundary crossings- Add SEP-1385 (Tool Execution Requirements) to Related Work- Add SEP-214 (On-Behalf-Of Token Exchange) to Related Work
@SamMorrowDrums
Copy link
ContributorAuthor

As an example trying to do Scope Challenge for GitHub MCP, I would ideally allow public repo access without a repo scope challenge, however then I won't be able to send a challenge for accessing private repos, so the granularity of 1 scope for one tool is definitely not sufficient for our use case. In order to allow least privilege generally, I am forced to provide a scope challenge for all available data, which is a problem when a legitimate user wants to access only public repo data and not give the token full repo scope.

This is currently not solvable.

SamMorrowDrums added a commit to SamMorrowDrums/modelcontextprotocol that referenced this pull requestNov 27, 2025
Introduces trust and sensitivity annotations for MCP requests and responses,enabling clients and servers to track, propagate, and enforce trust boundarieson data as it flows through tool invocations.Key features:- Result annotations: sensitiveHint, privateHint, openWorldHint, maliciousActivityHint, attribution- Request annotations for propagating trust context- Propagation rules ensuring sensitivity markers persist across agent sessions- Integration with Tool Resolution (modelcontextprotocol#1862) for pre-execution annotations- Per-item annotations for mixed results (e.g., search results)- Defense-in-depth approach complementing tool-level annotationsClosesmodelcontextprotocol#711
Adds argument-specific scope requirements as a key use case:- Motivation: Over-scoping problem (e.g., GitHub repo scope for public repos)- Future Extensibility: Dynamic securitySchemes example with noauth/oauth2- Related Work: Cross-reference to SEP-1488 and SEP-711 (Trust Annotations)The key insight is that static securitySchemes declarations requiremaximum permissions upfront, but tool resolution enables servers toreturn argument-specific requirements (e.g., noauth for public repos,repo scope only for private repos).This reduces unnecessary OAuth prompts and enables principle of leastprivilege in MCP tool invocations.
@dsp-antdsp-ant changed the titleSEP: Tool ResolutionSEP-1862: Tool ResolutionDec 3, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

proposalSEP proposal without a sponsor.SEP

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@SamMorrowDrums@findleyr@dsp-ant

[8]ページ先頭

©2009-2025 Movatter.jp