Repository navigation
Description
Preamble
- Title: Tool Execution Requirements Metadata
- Author: Zachary German
- Status: Proposal
- Created: 2025-08-15
- Updated: 2025-09-22
Abstract
This SEP proposes the introduction of a requires field in MCP tool definitions, allowing tools to explicitly declare execution requirements such as capabilities, permission scopes, roles, and resource-level permissions.
Currently, MCP tools only define input and output schemas, with no structured way to declare preconditions beyond basic type constraints. This gap leads to runtime failures when tools attempt to execute in contexts where required capabilities, roles, or permissions are unavailable.
The proposed requires field provides a declarative mechanism for servers and clients to validate compatibility earlier in the execution flow. This prevents wasted computation, enables efficient tool selection through requirement validation, supports conditional requirement logic for nuanced permission scenarios, enables better developer tooling, supports more transparent user experiences, and encourages development based on end-user requirements.
Motivation
The current MCP specification lacks a structured way for tools to describe preconditions that extend beyond input validation. This limitation introduces several issues:
- Late Failure Detection: Insufficient requirements (currently capabilities and permissions) are discovered only at execution time, after computation or context gathering has already occurred. (demonstrated in the demo script)
- Poor Developer Ergonomics: Server developers cannot easily verify whether tools align with server capabilities before deployment if they “plug’n’play” with tools developed by third-parties.
- Inconsistent Server Behavior for
tools/list: Servers vary between hiding tools based on negotiated client capabilities, or exposing them regardless of unmet client capability support and failing at runtime — leading to scenarios where clients need to brute-force tool alternatives due to failures that cannot be foreseen. - End User Frustration: Tools fail mid-execution, with no prior opportunity to preemptively address the issue. This is frustrating to users who would rather avoid brute-force tool-calling due to lack of requirements transparency.
- Lack of Ecosystem Roadmapping: Client implementers have no standardized telemetry on which missing capabilities most impact users, slowing adoption.
By adding a standardized requirements field, MCP will gain:
- “Unsupported tool” warnings to developers when building a server with tools requiring capabilities unsupported by the server (validating compatibility with “plug’n’play” tools developed by third-parties, even within a trusted organizational space).
- Improving discoverability, inviting
tools/listresponses to highlight unmet requirements, rather than hiding a tool.- This enables clients to make required changes to prepped inputs or create a new session where the requirements are met.
- Early validation at tool listing time, to avoid making tool calls destined for failure.
- Easier debugging and automated testing, by producing type-specific requirement check failures and leveraging tool requirements to avoid running tools that the test server/client does not meet requirements for.
- The ability for client vendors to collect telemetry regarding unmet requirements their end-users face in order to develop their client with data-driven prioritization.
Specification
Tool Definition
Servers SHOULD include a requires field in MCP tool definitions returned by tools/list.
requiresis an array of requirement objects, which are each evaluated by the client and resolved to a boolean value.- Each requirement object has a
typediscriminator, with additional fields depending on type. - Servers MAY include a
conditionalwrapper for a given requirement object, with a requiredrequirementfield and an optionalconditionsfield containing an array of requirement objects which all must be evaluated totruein order for therequirementfield object to be enforced.- If
conditionsis empty, then the conditions are considered undisclosed and therequirementobject may or may not be enforced.
- If
- Servers MAY include nested logical operators of
“anyOf”,“allOf”, each with their own requirement object array, or“not”, with a nested logical operator or requirement object, to enable complex requirement logic. - Servers MAY include the following
typevalues:“capability”, with an additional“name”field."name"field values referring to official MCP capabilities MUST be prefixed with“mcp:”(e.g."mcp:sampling")"name"field values referring to custom capabilities MUST be prefixed with"custom:"
“permission”, with an additional“subType”field.“subType”values are as follows:“scope”, with an additional“value”field."claim"with additional"name"and“value”fields.“resource”, with additional“uri”and“value”fields.“input”, with an optional“property”field, and a required“value”field.- If there is no
“property”defined in the“input”requirement object, the“value”applies to the whole input. - Any
“property”value MUST match a property name in the tool input schema.
- If there is no
Theoretical Example
"tools": [
{
"name": "imageGenerator",
"description": "Edits the baseImage (if provided) or generates an image, stores resulting image into the server-hosted image repository, then returns a reference to the resulting image.",
"inputSchema": {
"type": "object",
"properties": {
"baseImage": {
"type": "JPEG Image",
"description": "Image that the generation will be based on"
},
"imageRepoRef": {
"type": "Image Repository Path",
"description": "Path to server-hosted cloud storage for generated images"
},
"prompt": {
"type": "string",
"description": "Name of the prompt for transforming or generating the base image into the desired output image"
},
"promptArgs": {
"type": "array[string]",
"description": "The arguments for the named prompt"
}
},
"required": ["imageRepoRef","prompt","promptArgs"]
},
"outputSchema": { "type": "Image Repository Reference" },
"requires": [
{ "type": "capability", "name": "mcp:sampling" },
{ "anyOf": [
{ "type": "permission", "subType": "claim", "name": "role", "value": "admin" },
{ "type": "permission", "subType": "claim", "name": "role", "value": "owner" },
{ "type": "permission", "subType": "input", "property": "imageRepoRef", "value": "write" }
]},
{ "type": "permission", "subType": "scope", "value": "agent:sample_image" },
{ "type": "permission", "subType": "scope", "value": "write:sample_storage" },
{ "conditional": {
"conditions": [{ "not": { "type": "permission", "subType": "claim", "name": "role", "value": "prompter" }}],
"requirement": { "type": "permission", "subType": "scope", "value": "prompt:execute" }
}}
]
}
]Client Behavior
- The MCP client SHOULD evaluate the requirement objects and statements within the
requiresfield and avoid calling a tool if the requirements are unfulfilled.
Rationale
- Explicit over implicit: Tool requirements must be machine-readable to allow validation.
- Flexible expression: Supporting
anyOf/allOf/notenables both simple and complex requirement sets. - Resource-awareness: By supporting
inputpermissions, tools can constrain usage based on access to referenced inputs. - Generic field with multiple requirement types: By supporting multiple types in conjunction with logical operators, instances such as the example above are supported (being the owner, or having write permissions to the image repo).
- Declaring scopes in tool definitions: Some authorization servers require callers to “ask” for specific scopes. Knowing what scopes are needed and requesting exactly those scopes prior to calling a tool is intuitive to this expectation.
Alternatives considered:
- Tags-based approach: Rejected because tags lack structure and introduce ambiguity in how requirements should be evaluated.
- Capability-only/Permissions-only (separate fields) requirements: Too narrow — tools will depend on roles, scopes, and resource-level permissions going forward, with conditions relating the three. This is a future-looking approach.
Backward Compatibility
- This is a backward-compatible addition.
- Clients and servers that do not recognize
requireswill simply ignore it. - New SDK versions can introduce validation while old versions continue functioning unchanged.
Reference Implementation
Sample TypeScript-SDK implementation (very simple), as well as a demo script (in src/examples) that demonstrates:
- Errors hit by clients unaware of tool requirements due to lack of declaration in tools/list
- Requirements field tools/list example
- Scope renegotiation due to lack of required scope
Security Implications
- Care must be taken when referencing input schema properties to avoid leaking sensitive information.
- The
requiresfield will enable and encourage security practices that follow the principle of least-privilege.
Activity
[-]SEP: Tool Execution Requirements Metadata (Tool definition `requires` field)[/-][+]SEP: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/+]PederHP commentedon Aug 25, 2025
What if a tool may have a requirement? E.g. based on the input in a tool with relatively broad usage or many potential resource targets. Would it be relevant to be able to specify a potential requirement? As in a 'maybe' qualifier?
ZachGerman commentedon Aug 25, 2025
Only if it can present it in a way that allows for the client to preemptively prepare for such a requirement. If so, then yes, maybe we should add a logical 'maybe'-like operator that indicates the requirement could be enforced, but won't be in every case.
Edit: I'm considering adding this to the proposal. Good feedback!
[-]SEP: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/-][+]SEP-1385: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/+]ZachGerman commentedon Sep 4, 2025
Working on an example implementation for this in Typescript. Hoping to have it finished tomorrow or early next week!
ZachGerman commentedon Sep 16, 2025
Happy to say I've created a sample TypeScript-SDK implementation (very simple), as well as a demo script (in src/examples) that demonstrates:
Branch: https://github.com/ZachGerman/typescript-sdk/tree/feature/requirements-examples-with-oauth
ZachGerman commentedon Sep 16, 2025
Now I will look into how to possibly incorporate the
maybe-like operator mentioned above.ZachGerman commentedon Sep 16, 2025
@PederHP Circling back to your suggestion, as I've been thinking about it. This
maybecould apply to both capabilities or permissions, and I'm trying to think about how it could extend the current schema if it were included.It's starting to feel to me like something that should encompass a whole requirement statement, for example:
Does that seem right to you as well?
conditionalwas the best word I could come up with for it, and the spec would reflect that "Requirement statements in aconditionalwrapper are based on undisclosed server-side conditions during execution, and may or may not be required".ZachGerman commentedon Sep 21, 2025
Added
conditionalwith a requiredrequirementfield and an optionalconditionsfield. Noted that ifconditionsis empty, then they are considered "undisclosed" and therequirementfield object may or may not be enforced (maybe).[-]SEP-1385: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/-][+]SEP-1385: Tool Execution Requirements Metadata (Tool definition `requires` field)[/+]eisber commentedon Oct 9, 2025
do you have a full list of types?
ZachGerman commentedon Oct 9, 2025
This SEP currently outlines the following types:
capabilitymcp:)custom:)permissionscope(OAuth scopes)claim(JWT claims)resource(representation of permissions related to server-hosted/server-controlled resources)input(representation of permissions related to resources referenced by input properties containing references to server-hosted/server-controlled resources)WRT server-hosted/server-controlled resources, think either resources hosted by servers, or references to external resources (e.g. cloud resources) that the server has access to interact with during an operation, which may be limited by client authorization.
Open to suggestions if you have ideas for requirements not covered here.
aaguiarz commentedon Oct 28, 2025
Hey @ZachGerman
I'm thinking of scenarios like "the send_email tool can only send emails to addresses at acme.com", or "the submit_payment tool can only make payments < $100", or "the create_issue tool should only create issues in this list of repositories".
Would it be possible to express these kind of policies with your proposal? I'm not seeing how, but I might be missing something.
ZachGerman commentedon Oct 28, 2025
@aaguiarz I think it would be possible with an additional field aside from
capabilityorpermission, (something likeinputsince it would be an "input requirement") but I'm not sure if it fits better in requirements or in the tool input schema under the property's definition itself.e.g.
or
and for email domain:
We may want to have broader discussion about standard type requirements in input schemas.
Without additional input schema fields or this proposal with a
conditionrequirement, adding those requirements to the tool description or retry-encouraging error messages annotating unmet property requirements for failures are the two paths available.What do you think of the options between adding it in the
requiresfield outlined here versus the input schema property definitions?aaguiarz commentedon Oct 28, 2025
The main issue I see is who is going to set those permissions/restrictions.
It would not be the MCP author but whoever needs to configure permission (the user, or the admin of an MCP Gateway), right?
I think that even these would be configured by the admin of an MCP Gateway, not the MCP author:
ZachGerman commentedon Oct 28, 2025
Gateway would enforce these (AuthZ) things, but that doesn't remove the need for clients (ones who want to follow the principle of least-privilege & prevent avoidable tool call failures) to have access to the per-tool permissions (& capability) requirements in order to prepare before making tool calls.
So you're right that they (AuthZ requirements) would be set (and enforced) by Gateway admins, but MCP authors should still convey them when it's safe to do so.
aaguiarz commentedon Oct 29, 2025
Yes, users using MCP clients + Gateway Admins should be able to configure these. They would probably need an UI to set per-tool permissions.
As a user, I'd want to say "the Github MCP can only write to these repos" or to "repos in this org". "the GMail MCP can only send emails to addresses at acme.com", "the Stripe MCP can issue refunds up to $100".
I wonder if the tool can provide to the client metadata that would help creating those UIs where permission can be set, without having to go tool-per-tool and writing expressions.
For example:
I'm more concerned about how to define those policies, than how to enforce them, which seems a simpler problem.
That does not seem to be in the problem you want to solve with this proposal though :). I'd just say that the client/gateway will need to enforce some policy before calling the tool, and I'm don't think the tool can decide what that should be.
dsp-ant commentedon Jan 26, 2026
Given that this has no found a sponsor since August, I intent to close it and mark it as dormant. @ZachGerman if this is something you want to continue to pursue, let me know.
ZachGerman commentedon Jan 26, 2026
@dsp-ant It's definitely something I'd like to continue pursuing, as I strongly believe in the motivation behind the proposal. However, like you said, it hasn't garnered support from a sponsor even after incorporating received feedback, so I'm not sure where to take it from here.