SEP-2487: Add execution.requirements field to Tool for preconditions#2487
Draft
ZachGerman wants to merge 1 commit intomodelcontextprotocol:mainfrom
Draft
SEP-2487: Add execution.requirements field to Tool for preconditions#2487ZachGerman wants to merge 1 commit intomodelcontextprotocol:mainfrom
ZachGerman wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
5efd22b to
e302f93
Compare
Contributor
|
@ZachGerman if this is still a draft, we can just switch the PR to draft mode and keep the title clean of |
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.
Preamble
Summary
Add an optional
execution.requirementsfield to tool definitions:{ "name": "launch_rocket", "execution": { "requirements": [ "auth:oauth2", "auth:claim:role:mission_control", "capability:rocket.launch", "env:production", "state:weather.clear", "feature:launch_window.open" ] } }execution.requirementsdeclares a set of opaque requirement identifiers that MUST be satisfied for successful execution.This enables clients to optionally avoid actions that would deterministically fail, without introducing new semantics into MCP.
Motivation
Currently, tool calls may fail due to unmet preconditions such as missing capabilities, permissions, or environmental constraints. These failures:
MCP does not currently provide a standardized way for tools to declare execution preconditions.
As a result, clients must rely on trial-and-error execution or non-standard metadata, both of which limit interoperability and efficiency.
This proposal introduces a minimal, standardized mechanism to declare preconditions without requiring agreement on their semantics.
Specification
Field
capability:rocket.launch)Server Behavior
Client Behavior
Clients MAY use
execution.requirementsto influence behavior, subject to the following constraints:Clients MUST treat requirement strings as opaque.
Clients MUST NOT infer equivalence between different strings.
Clients MUST NOT use
execution.requirementsfor any decision-making unless:If the above conditions are met, clients MAY use
execution.requirementsto influence behavior (e.g., filtering, ranking, or avoiding failures).If any requirement is unknown, or if all requirements may be satisfied, clients MUST behave as if
execution.requirementswere not present.Backward Compatibility
This change is fully backward compatible:
execution.requirementswill ignore itThe field is optional and additive.
Security Considerations
This design ensures that incorrect or incomplete client implementations cannot introduce new security vulnerabilities.
Reference Implementation
A reference implementation can be achieved by:
execution.requirementsfieldReference implementation: TBD
Relationship to Existing Proposals
This proposal is intentionally minimal and complements ongoing work in the MCP ecosystem rather than overlapping with it.
Several proposals explore adjacent areas:
These proposals address important concerns but do not provide a minimal, enforceable mechanism for declaring execution preconditions.
This proposal fills that gap with a semantics-free primitive:
execution.requirements: string[]defines preconditions without standardizing meaningThis proposal does not compete with or replace existing work and can serve as a foundational primitive for future extensions.
Why Not
_meta?While
_metacan be used for experimentation, it does not establish a consistent contract across implementations.Using
_metawould result in:This proposal defines a minimal, shared contract that enables interoperability while remaining unopinionated about semantics.
Non-Goals
This proposal does not:
Future Work
This field is intentionally minimal and may be extended in the future to support:
All such extensions can be introduced without breaking compatibility with this proposal.
Rationale
This proposal provides a minimal primitive for declaring execution preconditions.
It is designed to:
By standardizing only the container (
string[]) and not the semantics, this approach allows the ecosystem to evolve naturally while providing immediate value.A strict, all-or-nothing client evaluation model ensures that
execution.requirementscan only be used when it is safe to do so, preventing partial or speculative reasoning.