Skip to content

Interface: FusionClient<TRouter>

Defined in: packages/core/src/client/FusionClient.ts:182

Type-safe client that provides autocomplete and compile-time validation for MCP tool calls.

Type Parameters

Type ParameterDescription
TRouter extends RouterMapThe router map inferred from the server's registry

Properties

proxy

ts
readonly proxy: FluentProxy<TRouter>;

Defined in: packages/core/src/client/FusionClient.ts:233

Fluent proxy for calling tools with dot-navigation.

Builds the action path from chained property accesses, then executes when invoked as a function.

Example

typescript
// Equivalent to: client.execute('projects.create', { name: 'V2' })
await client.proxy.projects.create({ name: 'V2' });

// Also works for deeper paths:
await client.proxy.platform.users.list({ limit: 10 });

Methods

execute()

ts
execute<TAction>(action, args): Promise<ToolResponse>;

Defined in: packages/core/src/client/FusionClient.ts:190

Execute a tool action with full type safety.

Type Parameters

Type Parameter
TAction extends string

Parameters

ParameterTypeDescription
actionTActionFull action path (e.g. 'projects.create')
argsTRouter[TAction]Typed arguments matching the action's schema

Returns

Promise<ToolResponse>

The tool response


executeBatch()

ts
executeBatch<TActions>(calls, options?): Promise<ToolResponse[]>;

Defined in: packages/core/src/client/FusionClient.ts:213

Execute multiple tool actions concurrently.

All calls run in parallel via Promise.all. Use { sequential: true } for ordered execution.

Type Parameters

Type Parameter
TActions extends readonly keyof TRouter & string[]

Parameters

ParameterTypeDescription
calls{ [K in string | number | symbol]: { action: TActions[K]; args: TRouter[TActions[K] & keyof TRouter] } }Array of { action, args } objects
options?{ sequential?: boolean; }Optional execution mode
options.sequential?boolean-

Returns

Promise<ToolResponse[]>

Array of tool responses, one per call

Example

typescript
const results = await client.executeBatch([
    { action: 'projects.list', args: { workspace_id: 'ws_1' } },
    { action: 'billing.balance', args: { account_id: 'acc_1' } },
]);