Skip to content

Interface: ToolConfig<TContext, TShared>

Defined in: packages/core/src/core/builder/defineTool.ts:101

Full defineTool() configuration.

Type Parameters

Type ParameterDefault typeDescription
TContext-Application context type
TShared extends ParamsMapParamsMapShared params map type

Properties

actions?

ts
optional actions: {
[key: string]: ActionDef<TContext, InferParams<TShared>, ParamsMap>;
};

Defined in: packages/core/src/core/builder/defineTool.ts:117

Flat actions — each action's params are inferred independently

Index Signature

ts
[key: string]: ActionDef<TContext, InferParams<TShared>, ParamsMap>

annotations?

ts
optional annotations: Record<string, unknown>;

Defined in: packages/core/src/core/builder/defineTool.ts:115

MCP tool annotations (e.g. { readOnlyHint: true, openWorldHint: true })


description?

ts
optional description: string;

Defined in: packages/core/src/core/builder/defineTool.ts:103

Tool description for the LLM


discriminator?

ts
optional discriminator: string;

Defined in: packages/core/src/core/builder/defineTool.ts:107

Discriminator field name (default: 'action')


groups?

ts
optional groups: {
[key: string]: GroupDef<TContext, InferParams<TShared>>;
};

Defined in: packages/core/src/core/builder/defineTool.ts:119

Hierarchical groups (mutually exclusive with actions)

Index Signature

ts
[key: string]: GroupDef<TContext, InferParams<TShared>>

middleware?

ts
optional middleware: (
  | MiddlewareFn<TContext>
  | MiddlewareDefinition<TContext, Record<string, unknown>>)[];

Defined in: packages/core/src/core/builder/defineTool.ts:113

Global middleware applied to all actions (accepts both MiddlewareFn and MiddlewareDefinition)


shared?

ts
optional shared: 
  | ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny, {
[key: string]: any;
}, {
[key: string]: any;
}>
  | TShared;

Defined in: packages/core/src/core/builder/defineTool.ts:111

Parameters shared across all actions


tags?

ts
optional tags: string[];

Defined in: packages/core/src/core/builder/defineTool.ts:105

Capability tags for filtering


toonDescription?

ts
optional toonDescription: boolean;

Defined in: packages/core/src/core/builder/defineTool.ts:109

Use TOON-formatted descriptions