ToolCallContext
Defined in: packages/core/src/mcp/tools/index.ts:40
Verified per-call actor facts derived from the dispatch’s auth decision, passed
as an OPTIONAL second argument to Tool.handler. This is the single canonical
actor shape shared across consumers (WP2 audit, WP4 provenance, WP5 per-agent
attribution — see GAPS A30); do not fork a divergent one.
It is built from the transport’s verified auth info, never from the tool input, so a handler can attribute a mutation to the real principal. All fields are optional: an unauthenticated/legacy call carries none of them.
Properties
Section titled “Properties”actorUserId?
Section titled “actorUserId?”
optionalactorUserId?:string
Defined in: packages/core/src/mcp/tools/index.ts:42
The verified tenant/principal the call acts as (post-delegation).
apiKeyId?
Section titled “apiKeyId?”
optionalapiKeyId?:string
Defined in: packages/core/src/mcp/tools/index.ts:44
The calling API key’s id, when the request was API-key authenticated.
delegated?
Section titled “delegated?”
optionaldelegated?:boolean
Defined in: packages/core/src/mcp/tools/index.ts:48
True when an admin-scoped key delegated to another tenant’s userId.
scopes?
Section titled “scopes?”
optionalscopes?:string[]
Defined in: packages/core/src/mcp/tools/index.ts:46
The principal’s granted scopes.