Implementation:1broseidon Ketch mcp ToolAnnotations
| Knowledge Sources | |
|---|---|
| Domains | MCP, Tool_Annotations |
| Last Updated | 2026-10-27 00:00 GMT |
Overview
Declares each MCP tool's network/mutation behavior: the five fetching tools are read-only open-world; `tag` mutates local state and never touches the network.
Description
readOnlyOpenWorld marks a tool as a non-mutating fetcher that talks to the open web (`ReadOnlyHint: true`, `OpenWorldHint: true`) — applied to search/code/docs/scrape/crawl. localMutating marks a tool that changes local state and never touches the network (`ReadOnlyHint: false`, `OpenWorldHint: false`) — applied to `tag`, which writes and deletes durable bookmarks.
Usage
Attached to each tool at registration time. Agents and clients use the hints to decide when to prompt for confirmation or route requests.
Code Reference
Source Location
- Repository: ketch
- File: mcp/server.go
Signature
// localMutating marks a tool that changes local state and never touches the network.
func localMutating() *mcpsdk.ToolAnnotations
// readOnlyOpenWorld marks a tool as a non-mutating fetcher that talks to the open web.
func readOnlyOpenWorld() *mcpsdk.ToolAnnotations
Import
import (
mcpsdk "github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/1broseidon/ketch/mcp"
)
I/O Contract
Outputs
| Function | ReadOnlyHint | OpenWorldHint |
|---|---|---|
| readOnlyOpenWorld | true | true |
| localMutating | false | false |
Usage Examples
Attaching Annotations
// search/code/docs/scrape/crawl: read-only, open-world
s.mcp.AddTool(ctx, tool, handler, mcpsdk.WithAnnotations(mcp.readOnlyOpenWorld()))
// tag: mutates local index, no network
s.mcp.AddTool(ctx, tagTool, tagHandler, mcpsdk.WithAnnotations(mcp.localMutating()))