AxMCPExecutionContext
Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L95
Run-scoped MCP state shared by Ax programs.
Constructors
Constructor
new AxMCPExecutionContext(
clients:
| AxMCPClient
| readonly AxMCPClient[],
inheritance: AxMCPInheritance,
ucpClients:
| AxUCPClient
| readonly AxUCPClient[]): AxMCPExecutionContext;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L101
Parameters
| Parameter | Type | Default value |
|---|---|---|
clients | | AxMCPClient | readonly AxMCPClient[] | undefined |
inheritance | AxMCPInheritance | 'all' |
ucpClients | | AxUCPClient | readonly AxUCPClient[] | [] |
Returns
AxMCPExecutionContext
Properties
| Property | Modifier | Type | Default value |
|---|---|---|---|
inheritance | readonly | AxMCPInheritance | 'all' |
Accessors
clients
Get Signature
get clients(): readonly AxMCPClient[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L127
Returns
readonly AxMCPClient[]
ucpClients
Get Signature
get ucpClients(): readonly AxUCPClient[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L131
Returns
readonly AxUCPClient[]
Methods
cancelTasksCreatedSince()
cancelTasksCreatedSince(snapshot: AxMCPTaskSnapshot): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L226
Parameters
| Parameter | Type |
|---|---|
snapshot | AxMCPTaskSnapshot |
Returns
Promise<void>
forChild()
forChild(inheritance: AxMCPInheritance): undefined | AxMCPExecutionContext;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L136
Derive the client view that a nested user program is allowed to receive.
Parameters
| Parameter | Type |
|---|---|
inheritance | AxMCPInheritance |
Returns
undefined | AxMCPExecutionContext
getCatalogRevision()
getCatalogRevision(): string;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L190
Returns
string
getClient()
getClient(client: string | AxMCPClient): AxMCPClient;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L163
Parameters
| Parameter | Type |
|---|---|
client | string | AxMCPClient |
Returns
getContinuationState()
getContinuationState(): AxMCPContinuationState;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L204
Returns
getTaskSnapshot()
getTaskSnapshot(): AxMCPTaskSnapshot;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L217
Returns
getToolBindings()
getToolBindings(): AxFunction[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L178
Bind raw MCP tools without using the lossy client.toFunction() adapter.
Returns
getUCPClient()
getUCPClient(client: string | AxUCPClient): AxUCPClient;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L170
Parameters
| Parameter | Type |
|---|---|
client | string | AxUCPClient |
Returns
initialize()
initialize(): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L155
Returns
Promise<void>
resolveContext()
resolveContext(requests: readonly AxMCPContextRequest[]): Promise<AxMCPResolvedContext[]>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L286
Parameters
| Parameter | Type | Default value |
|---|---|---|
requests | readonly AxMCPContextRequest[] | [] |
Returns
Promise<AxMCPResolvedContext[]>
resolveContextPrompt()
resolveContextPrompt(requests: readonly AxMCPContextRequest[]): Promise<(
| {
cache?: boolean;
content: string;
role: "system";
}
| {
cache?: boolean;
content: | string
| (
| {
cache?: boolean;
text: string;
type: "text";
}
| {
altText?: string;
cache?: boolean;
details?: "high" | "low" | "auto";
image: string;
mimeType: string;
optimize?: "auto" | "quality" | "size";
type: "image";
}
| {
cache?: boolean;
channels?: number;
data: string;
duration?: number;
format?: AxAudioFormat;
mimeType?: string;
sampleRate?: number;
transcription?: string;
type: "audio";
}
| {
cache?: boolean;
data: string;
extractedText?: string;
filename?: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
extractedText?: string;
filename?: string;
fileUri: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
cachedContent?: string;
description?: string;
title?: string;
type: "url";
url: string;
})[];
name?: string;
role: "user";
}
| {
audio?: {
id: string;
transcript?: string;
};
cache?: boolean;
content?: string;
functionCalls?: object[];
name?: string;
role: "assistant";
thought?: string;
thoughtBlocks?: AxThoughtBlockItem[];
}
| {
cache?: boolean;
content?: AxFunctionResultContent;
functionId: string;
isError?: boolean;
protocolResult?: {
protocol: NonNullable<
| undefined
| {
annotations?: Record<..., ...>;
kind: "mcp";
meta?: Record<..., ...>;
name: string;
namespace: string;
}
| {
kind: "ucp";
meta?: Record<..., ...>;
name: string;
namespace: string;
}>;
value: unknown;
};
result: string;
role: "function";
})[]>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L314
Parameters
| Parameter | Type | Default value |
|---|---|---|
requests | readonly AxMCPContextRequest[] | [] |
Returns
Promise<(
| {
cache?: boolean;
content: string;
role: "system";
}
| {
cache?: boolean;
content: | string
| (
| {
cache?: boolean;
text: string;
type: "text";
}
| {
altText?: string;
cache?: boolean;
details?: "high" | "low" | "auto";
image: string;
mimeType: string;
optimize?: "auto" | "quality" | "size";
type: "image";
}
| {
cache?: boolean;
channels?: number;
data: string;
duration?: number;
format?: AxAudioFormat;
mimeType?: string;
sampleRate?: number;
transcription?: string;
type: "audio";
}
| {
cache?: boolean;
data: string;
extractedText?: string;
filename?: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
extractedText?: string;
filename?: string;
fileUri: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
cachedContent?: string;
description?: string;
title?: string;
type: "url";
url: string;
})[];
name?: string;
role: "user";
}
| {
audio?: {
id: string;
transcript?: string;
};
cache?: boolean;
content?: string;
functionCalls?: object[];
name?: string;
role: "assistant";
thought?: string;
thoughtBlocks?: AxThoughtBlockItem[];
}
| {
cache?: boolean;
content?: AxFunctionResultContent;
functionId: string;
isError?: boolean;
protocolResult?: {
protocol: NonNullable<
| undefined
| {
annotations?: Record<…, …>;
kind: "mcp";
meta?: Record<…, …>;
name: string;
namespace: string;
}
| {
kind: "ucp";
meta?: Record<…, …>;
name: string;
namespace: string;
}>;
value: unknown;
};
result: string;
role: "function";
})[]>
restoreContinuationState()
restoreContinuationState(state:
| undefined
| Readonly<AxMCPContinuationState>): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/execution.ts#L248
Parameters
| Parameter | Type |
|---|---|
state | | undefined | Readonly<AxMCPContinuationState> |
Returns
Promise<void>