Define tools for agents using the fluent builder API.
Tool Types
Agents can use several types of tools:
| Type | Description |
|---|---|
| Client | Executed by your code (with handler) |
| App | Runs an inference.sh app |
| Agent | Delegates to a sub-agent |
| Webhook | Calls an external URL |
| Internal | Built-in: plan, memory, widgets, finish |
Quick Example
1from inferencesh import tool, string2 3greet = (4 tool("greet")5 .describe("Greet a user")6 .param("name", string("User's name"))7 .handler(lambda args: f"Hello, {args['name']}!")8 .build()9)Parameter Types
All tool builders share these parameter types:
1from inferencesh import string, number, integer, boolean, enum_of, array, obj, optional2 3# Basic types4string("Description") # Text input5number("Description") # Decimal number6integer("Description") # Whole number7boolean("Description") # True/false8 9# Complex types10enum_of(["a", "b"], "desc") # Choice from list11array(string(), "desc") # List of items12obj({"key": string()}, "desc") # Nested object13optional(string()) # Optional parameterLearn More
- Client Tools — Handler-based tools
- App Tools — Run inference.sh apps
- Agent Tools — Delegate to sub-agents
- Webhook Tools — Call external APIs
- Internal Tools — Plan, memory, widgets
- Approval Settings — Human-in-the-loop