Skip to content

Add optional annotations for tagging tools as readOnly and destructive. #927

@drstrangelooker

Description

@drstrangelooker

Prerequisites

What are you trying to do that currently feels hard or impossible?

Nothing currently. This is just a nice thing to add.

Suggested Solution(s)

https://modelcontextprotocol.io/docs/concepts/tools#tool-definition-structure

According to the latest spec, tools can have the following annotations:

    readOnlyHint?: boolean;    // If true, the tool does not modify its environment
    destructiveHint?: boolean; // If true, the tool may perform destructive updates
    idempotentHint?: boolean;  // If true, repeated calls with same args have no additional effect
    openWorldHint?: boolean;   // If true, tool interacts with external entities

Agents and users can use this to decide whether to run a tool.

In MCP Toolbox a tool that runs a select or fetches metadata should have the readOnly hint. A tool that runs INSERT/UPDATE/DELETE should have a destructive hint.

Alternatives Considered

No response

Additional Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions