Skip to content

feat(mcp): add MCP tool annotations (readOnlyHint, destructiveHint, title) to all 16 tools #136

@bug-ops

Description

@bug-ops

Description

mcpls exposes 16 MCP tools but none carry ToolAnnotations metadata. The MCP 2025-11-25 spec formalizes tool annotations (readOnlyHint, destructiveHint, idempotentHint, title) as hints that help AI clients decide when to invoke tools safely (e.g., skip confirmation dialogs for read-only tools).

rmcp 1.5.0 — already in use — fully supports ToolAnnotations via both the builder API (.annotate(ToolAnnotations::new().read_only(true))) and the #[tool] macro (annotations(read_only_hint = true)). No new dependencies are required.

Proposed Classification

Tool readOnlyHint destructiveHint idempotentHint
hover, definition, references, diagnostics, document_symbols, workspace_symbols, completions, signature_help, inlay_hints, call_hierarchy_prepare, call_hierarchy_incoming, call_hierarchy_outgoing true false true
rename false true false
format_document false false true
code_actions (apply=false) true false true
code_actions (apply=true) false true false

Note: code_actions with apply=true vs apply=false can't be disambiguated at the tool level since they're the same tool — apply destructiveHint = true to be safe.

Expected Behavior

AI clients receive accurate annotations so they can (a) skip unnecessary user confirmations for read-only lookups and (b) prompt before rename/apply operations.

Actual Behavior

All 16 tools have no annotations; clients must assume the worst-case (destructive) for all of them.

Reproduction Steps

  1. Connect any MCP client to mcpls
  2. List tools — observe no annotations field in any tool definition

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: cosmetic, edge case unlikely in practiceenhancementNew feature or requestmcpls-coremcpls-core crate changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions