Skip to content

toolGrantEntry

toolGrantEntry(subject): ToolApprovalEntry | McpToolApprovalEntry | null

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:301

§4.7.4/§6 — the entry the escalation menu writes for a tool call: the tool’s identity, plus the host where the call carries one.

The counterpart of shellGrantEntry and the single place a tool grant’s entry is built, so the line the prompt shows the human and the line that lands in the store cannot drift apart.

Identity, never arguments. A grant recording a full argument signature would never match a second time — not a narrower grant, a useless one. That is knowingly broader than the shell’s exact-command grant, with one bound: on the shell path §4.6’s escape carries the host inside the command string, so it is host-scoped by construction, while a tool-identity-only grant on a fetch tool would be every host, forever.

server on an mcpTool grant is the user’s own mcpServers config key (§4.7.5). Nothing a server declares about its own name participates, and a grant for one server’s tool can never be claimed by another server’s same-named tool because the other server sits under a different key.

Returns null for a call whose server could not be resolved. UNRESOLVED_MCP_SERVER is the empty string, which server (z.string().min(1)) cannot hold: such an entry would be written to the file and then silently dropped by the grammar’s own validator on the next read, so the human would be told their approval was remembered when it was not. A call nobody can attribute to a server is not one anything can remember.

ToolApprovalSubject | McpToolApprovalSubject

ToolApprovalEntry | McpToolApprovalEntry | null