Configuration object for creating a tool.
Used with the defineTool helper function.
const tool = defineTool({ name: 'summarize', input: {} as { text: string }, output: {} as { summary: string }, description: 'Summarize text', run: async (input) => ({ output: { summary: input.text.slice(0, 100) } })}); Copy
const tool = defineTool({ name: 'summarize', input: {} as { text: string }, output: {} as { summary: string }, description: 'Summarize text', run: async (input) => ({ output: { summary: input.text.slice(0, 100) } })});
Input type for the tool
Output type for the tool
Unique identifier for this tool.
Type signature for input data.
Type signature for output data.
Optional
Human-readable description.
Function to execute the tool.
Configuration object for creating a tool.
Used with the defineTool helper function.
Example