Skip to content

[plan] Add ToolAnnotations to all 8 MCP server tools #16917

@github-actions

Description

@github-actions

Objective

Add ToolAnnotations to all 8 MCP server tools in pkg/cli/mcp_server.go to improve LLM client understanding of tool behavior.

Context

Discussion #16774 noted that the displayDetailedToolInfo() function in the inspector already renders tool annotations, but the server tools don't define Annotations. Adding them helps LLM clients reason about tool safety, idempotency, and side effects.

Suggested Annotations

Tool ReadOnlyHint IdempotentHint DestructiveHint OpenWorldHint
status true true false
compile false true false false
logs true true true
audit true true true
mcp-inspect true true true
add false false true
update false false true
fix false true false false

Steps

  1. Open pkg/cli/mcp_server.go
  2. For each mcp.AddTool() call, add an Annotations field to the &mcp.Tool{} struct using the table above
  3. Run make fmt && make build && make test-unit

Example

mcp.AddTool(server, &mcp.Tool{
    Name: "status",
    Annotations: &mcp.ToolAnnotations{
        ReadOnlyHint:  true,
        IdempotentHint: true,
        OpenWorldHint: false,
    },
    // ...
}, handler)

Files to Modify

  • pkg/cli/mcp_server.go

Acceptance Criteria

  • All 8 tools have Annotations defined
  • Annotations match the table above
  • make build and make test-unit pass

Generated by Plan Command for issue #discussion #16774

  • expires on Feb 21, 2026, 9:47 PM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions