Function: bindTools()
@providerprotocol/ai / proxy / bindTools
Function: bindTools()
Section titled “Function: bindTools()”bindTools(
schemas,implementations):Tool<unknown,unknown>[]
Defined in: src/providers/proxy/server/webapi.ts:367
Bind tool schemas to implementation functions.
Takes tool schemas from the request and binds them to your server-side implementations.
Parameters
Section titled “Parameters”schemas
Section titled “schemas”Tool schemas from the request
object[] | undefined
implementations
Section titled “implementations”Record<string, (params) => unknown | Promise<unknown>>
Map of tool name to implementation
Returns
Section titled “Returns”Tool<unknown, unknown>[]
Array of complete Tool objects
Example
Section titled “Example”const { tools: schemas } = parseBody(body);
const tools = bindTools(schemas, { get_weather: async ({ location }) => fetchWeather(location), search: async ({ query }) => searchDB(query),});
const instance = llm({ model, tools });