collectDeclaredMcpToolAnnotations
collectDeclaredMcpToolAnnotations(
tools):ReadonlyMap<string,DeclaredToolAnnotations>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/toolAnnotationSources.ts:273
§4.7.1 — collect what the connected MCP servers declared, keyed by the registered tool name
(mcp__<server>__<tool>).
Keying by the registered name rather than by a parsed (server, tool) pair is what makes the
lookup immune to the __-in-a-server-key hazard: the reader rebuilds the same string with
mcpToolRegisteredName from a server key it has already resolved against the configured set, so
nothing is ever split apart and re-joined differently.
Only MCP-namespaced names are collected. Our own tools’ annotations come from BUILT_IN_TOOL_ANNOTATIONS and must not be reachable through the per-hint-trusted MCP path, and a custom tool’s own metadata is not ours to believe either (§4.7.1).
Parameters
Section titled “Parameters”readonly AnnotationDeclaringTool[]
Returns
Section titled “Returns”ReadonlyMap<string, DeclaredToolAnnotations>