Inference Logoinference.sh

Building Tools

Define tools for agents using the fluent builder API.


Tool Types

Agents can use several types of tools:

TypeBuilderDescription
Clienttool()Executed by your code (with handler)
AppappTool()Runs an inference.sh app
AgentagentTool()Delegates to a sub-agent
WebhookwebhookTool()Calls an external URL
Internalbuilt-inPlan, memory, widgets, finish

Quick Example

typescript
1import { tool, string } from '@inferencesh/sdk';23const greet = tool('greet')4  .describe('Greet a user')5  .param('name', string('User name'))6  .handler(args => `Hello, ${args.name}!`)7  .build();

Parameter Types

All tool builders share these parameter types:

TypeExample
string('desc')Text input
number('desc')Decimal number
integer('desc')Whole number
boolean('desc')True/false
enumOf(['a', 'b'], 'desc')Choice from list
array(string(), 'desc')List of items
obj({key: string()}, 'desc')Nested object
optional(string())Optional parameter

Learn More

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.