Skip to content

approvalSubjectForToolName

approvalSubjectForToolName(toolName, configuredMcpServers): ToolApprovalSubject | McpToolApprovalSubject

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

§4.7.1/§4.7.5 — the subject a gated call on toolName presents to the rule matcher.

A name outside the MCP namespace is one of ours (a built-in, or a tool the user wired into their own config): kind: 'tool', the trusted provenance. A name inside it is kind: 'mcpTool' always — with its resolved server where the configured keys name exactly one, and with UNRESOLVED_MCP_SERVER otherwise.

string

The registered tool name, exactly as the model called it.

Iterable<string>

Object.keys(config.mcpServers) — the user’s own keys, and the only thing consulted. Nothing a server declares about its own name ever participates (§4.7.5).

ToolApprovalSubject | McpToolApprovalSubject