Skip to content

Documentation / @agentick/mcp / MCPCompletionContext

Interface: MCPCompletionContext

Defined in: protocol/types.ts:518

Extended handler context for completion calls. Adds resolvedArguments carrying the values of any sibling arguments the user has already entered. Surfaced from the protocol's context.arguments field.

Extends

Properties

elicit?

optional elicit: ElicitAPI

Defined in: protocol/types.ts:360

Sugar surface for elicitation/create — pause mid-tool to ask the user for structured input (form mode) or to walk an external URL flow (URL mode). Undefined when the client did not advertise any elicitation sub-capability.

Inherited from

MCPHandlerContext.elicit


extra

extra: MCPHandlerExtra

Defined in: protocol/types.ts:320

Raw SDK handler extra — sessionId, requestId, signal, authInfo.

Inherited from

MCPHandlerContext.extra


request

request: MCPRequestContext

Defined in: protocol/types.ts:318

Authenticated request context — user identity, tenant, roles, metadata.

Inherited from

MCPHandlerContext.request


resolvedArguments

resolvedArguments: Record<string, string>

Defined in: protocol/types.ts:523

Already-resolved sibling arguments for the same prompt or template. Empty object when the request omits context.arguments.


roots

roots: RootsAPI

Defined in: protocol/types.ts:344

Sugar surface for roots/list — fetch the client's declared filesystem roots and check whether paths are within them. Always present; returns an empty list when the client did not advertise the roots capability. Permissive defaults: assertWithin and isWithin no-op (pass) when no roots are declared.

Per MCP spec 2025-11-25, root URIs MUST be file://. Non-file schemes are filtered out defensively.

Inherited from

MCPHandlerContext.roots


sample?

optional sample: SampleAPI

Defined in: protocol/types.ts:352

Sugar surface for sampling/createMessage — ask the client to run an LLM completion on the server's behalf. Undefined when the client did not advertise the sampling capability. Use ctx.sample?.text(...) or guard explicitly: if (!ctx.sample) throw ....

Inherited from

MCPHandlerContext.sample


sendProgress()?

optional sendProgress: (progress, total?, message?) => Promise<void>

Defined in: protocol/types.ts:333

Send a progress notification to the client. Only available when the client supplied a progressToken in _meta. Undefined otherwise.

Parameters

progress

number

Current progress value

total?

number

Total progress value (optional)

message?

string

Human-readable progress message (optional)

Returns

Promise<void>

Inherited from

MCPHandlerContext.sendProgress


sessionId

sessionId: string

Defined in: protocol/types.ts:322

Shortcut: the session ID for this request.

Inherited from

MCPHandlerContext.sessionId


signal

signal: AbortSignal

Defined in: protocol/types.ts:324

AbortSignal — aborted when the client sends notifications/cancelled.

Inherited from

MCPHandlerContext.signal

Released under the ISC License.