Tools
cascadeflow provides a tool calling framework for agent loops. Define tools, execute them, and track tool call budgets.ToolConfig
Define a tool with its schema and handler function.| Field | Type | Description |
|---|---|---|
name | str | Tool name |
description | str | What the tool does (sent to the model) |
parameters | dict | JSON Schema for tool parameters |
handler | Callable | Function to execute when tool is called |
ToolExecutor
Executes tool calls and returns results.@tool Decorator
Define tools using a decorator for cleaner syntax.Tool Call Limits
Usemax_tool_calls in cascadeflow.run() to cap tool usage:
deny_tool action — the agent continues with what it has.
ToolResult
Returned byToolExecutor.execute().
| Field | Type | Description |
|---|---|---|
tool_name | str | Name of the tool that was called |
result | Any | Return value from the handler |
error | str | None | Error message if execution failed |