Skip to content

Documentation / @agentick/mcp / MCPCompletionContext

Interface: MCPCompletionContext ​

Defined in: protocol/types.ts:542

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:384

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:344

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

Inherited from ​

MCPHandlerContext.extra


request ​

request: MCPRequestContext

Defined in: protocol/types.ts:342

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

Inherited from ​

MCPHandlerContext.request


resolvedArguments ​

resolvedArguments: Record<string, string>

Defined in: protocol/types.ts:547

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:368

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:376

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:357

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:346

Shortcut: the session ID for this request.

Inherited from ​

MCPHandlerContext.sessionId


signal ​

signal: AbortSignal

Defined in: protocol/types.ts:348

AbortSignal — aborted when the client sends notifications/cancelled.

Inherited from ​

MCPHandlerContext.signal

Released under the ISC License.