DOCSAPI reference

FUNCTION

createTool

function createTool(
   name, 
   description, 
   func, 
   parameters?
): Tool;

Defined in: tool.ts:68

Creates a tool from a plain function.

Parameters

Parameter Type Description
name string Unique tool name.
description string Description that tells the model when to use the tool.
func ToolFunction Implementation. Synchronous and asynchronous functions are both accepted.
parameters? ToolParameters JSON Schema of the arguments.

Returns

Tool