Skip to content

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.

optional actorUserId?: string

Defined in: packages/core/src/mcp/tools/index.ts:42

The verified tenant/principal the call acts as (post-delegation).


optional apiKeyId?: string

Defined in: packages/core/src/mcp/tools/index.ts:44

The calling API key’s id, when the request was API-key authenticated.


optional delegated?: boolean

Defined in: packages/core/src/mcp/tools/index.ts:48

True when an admin-scoped key delegated to another tenant’s userId.


optional scopes?: string[]

Defined in: packages/core/src/mcp/tools/index.ts:46

The principal’s granted scopes.