Skip to content

SEP-1385: Tool Execution Requirements Metadata (Tool definition requires field) #1385

Closed

Description

@ZachGerman

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/list responses 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.

  • requires is an array of requirement objects, which are each evaluated by the client and resolved to a boolean value.
  • Each requirement object has a type discriminator, with additional fields depending on type.
  • Servers MAY include a conditional wrapper for a given requirement object, with a required requirement field and an optional conditions field containing an array of requirement objects which all must be evaluated to true in order for the requirement field object to be enforced.
    • If conditions is empty, then the conditions are considered undisclosed and the requirement object may or may not be enforced.
  • 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 type values:
    • “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.

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 requires field 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/not enables both simple and complex requirement sets.
  • Resource-awareness: By supporting input permissions, 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 requires will 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

Branch: https://github.com/ZachGerman/typescript-sdk/tree/feature/requirements-examples-with-oauth

Security Implications

  • Care must be taken when referencing input schema properties to avoid leaking sensitive information.
  • The requires field will enable and encourage security practices that follow the principle of least-privilege.

Activity

  1. changed the title [-]SEP: Tool Execution Requirements Metadata (Tool definition `requires` field)[/-] [+]SEP: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/+] on Aug 25, 2025
  2. PederHP commented on Aug 25, 2025

    @PederHP
    Member

    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?

  3. ZachGerman commented on Aug 25, 2025

    @ZachGerman
    ContributorAuthor

    Would it be relevant to be able to specify a potential requirement? As in a 'maybe' qualifier?

    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!

  4. changed the title [-]SEP: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/-] [+]SEP-1385: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/+] on Aug 27, 2025
  5. added
    proposal
    on Aug 28, 2025
  6. ZachGerman commented on Sep 4, 2025

    @ZachGerman
    ContributorAuthor

    Working on an example implementation for this in Typescript. Hoping to have it finished tomorrow or early next week!

  7. ZachGerman commented on Sep 16, 2025

    @ZachGerman
    ContributorAuthor

    Happy to say I've created a 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 client-side tool calling error due to lack of required scope

    Branch: https://github.com/ZachGerman/typescript-sdk/tree/feature/requirements-examples-with-oauth

  8. ZachGerman commented on Sep 16, 2025

    @ZachGerman
    ContributorAuthor

    Now I will look into how to possibly incorporate the maybe-like operator mentioned above.

  9. ZachGerman commented on Sep 16, 2025

    @ZachGerman
    ContributorAuthor

    @PederHP Circling back to your suggestion, as I've been thinking about it. This maybe could 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:

        "requires": [
          { "type": "capability", "name": "mcp:sampling" },
          { "conditional":    
              { "anyOf": [
                  { "type": "permission", "subType": "claim", "name": "role", "value": "admin" },
                  { "type": "permission", "subType": "claim", "name": "role", "value": "owner" },
                  { "type": "permission", "subType": "input", "resource": "imageRepoRef", "value": "write" }
              ]}
          }
          { "type": "permission", "subType": "scope", "value": "agent:sample_image" },
          { "conditional": { "type": "permission", "subType": "scope", "value": "write:sample_storage" }}
        ]

    Does that seem right to you as well?
    conditional was the best word I could come up with for it, and the spec would reflect that "Requirement statements in a conditional wrapper are based on undisclosed server-side conditions during execution, and may or may not be required".

  10. ZachGerman commented on Sep 21, 2025

    @ZachGerman
    ContributorAuthor

    Added conditional with a required requirement field and an optional conditions field. Noted that if conditions is empty, then they are considered "undisclosed" and the requirement field object may or may not be enforced (maybe).

  11. changed the title [-]SEP-1385: Tool Execution Requirements Metadata (Tool definition `requires` field) (WIP)[/-] [+]SEP-1385: Tool Execution Requirements Metadata (Tool definition `requires` field)[/+] on Sep 22, 2025
  12. eisber commented on Oct 9, 2025

    @eisber

    do you have a full list of types?

  13. ZachGerman commented on Oct 9, 2025

    @ZachGerman
    ContributorAuthor

    do you have a full list of types?

    This SEP currently outlines the following types:

    • capability
      • Official (prefixed with mcp:)
      • Custom (prefixed with custom:)
    • permission
      • scope (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.

  14. aaguiarz commented on Oct 28, 2025

    @aaguiarz

    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.

  15. ZachGerman commented on Oct 28, 2025

    @ZachGerman
    ContributorAuthor

    @aaguiarz I think it would be possible with an additional field aside from capability or permission, (something like input since 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.

    "type": "number",
    "range": "(0,100)"

    or

    "type": "number",
    "min": "0.0",
    "max": "100.0"

    and for email domain:

    "type": "string"
    "pattern": "^[^@]+@acme\\.com$"

    We may want to have broader discussion about standard type requirements in input schemas.

    Without additional input schema fields or this proposal with a condition requirement, 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 requires field outlined here versus the input schema property definitions?

  16. aaguiarz commented on Oct 28, 2025

    @aaguiarz

    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:

     { "conditional":    
              { "anyOf": [
                  { "type": "permission", "subType": "claim", "name": "role", "value": "admin" },
                  { "type": "permission", "subType": "claim", "name": "role", "value": "owner" },
              ]}
          }
    
  17. ZachGerman commented on Oct 28, 2025

    @ZachGerman
    ContributorAuthor

    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.

  18. aaguiarz commented on Oct 29, 2025

    @aaguiarz

    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:

    • The GMail MCP could say "these parameters are emails", so you can then filter by domain.
    • The Stripe MCP could say "these parameters are amounts", so you can provide $ limits.
    • The Github MCP could say "there's an organization/repository hierarchy that's the one you'd want to use for deciding permissions".

    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.

  19. dsp-ant commented on Jan 26, 2026

    @dsp-ant
    Member

    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.

  20. ZachGerman commented on Jan 26, 2026

    @ZachGerman
    ContributorAuthor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SEPdormantproposal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions