Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / / ToolSpec

Type Alias: ToolSpec<TInput, TOutput, TDeps>

ts
type ToolSpec<TInput, TOutput, TDeps> = Omit<Tool<TInput, TOutput, TDeps>, "execute"> & {
  execute: (input, ctx) => Promise<
     | TOutput
     | ToolReturn<TOutput>
    | void>;
};

Defined in: packages/tools/src/builder/tool.ts:26

Spec accepted by the tool factory. Mirrors the Tool interface but accepts the execute field as the second positional parameter or as a property — both work equivalently.

Type Declaration

NameTypeDefined in
execute()(input, ctx) => Promise< | TOutput | ToolReturn&lt;TOutput&gt; | void>packages/tools/src/builder/tool.ts:30

Type Parameters

Type ParameterDefault type
TInputunknown
TOutputunknown
TDepsunknown

Stable