SimpleFunctionTool wraps a synchronous Python function as a BaseTool that an LLM or agent can invoke. It derives the tool name from the function, uses its docstring as the description when available, and generates a JSON Schema for its parameters from the function signature. section 2.2 section 2.2.1
A tool call follows this flow:
- Validate the call's arguments against the generated parameter schema. section 2.2.1
- Pass valid arguments to the wrapped function and return its result in a ToolCallResult; report validation or execution errors in the result. section 2.2.1
Hailstone step
Wrap a function that computes one Hailstone sequence step. Its name, docstring, and integer input parameter provide the tool's metadata and schema, allowing an agent to invoke it with a value such as 3. section 2.2 section 2.2.1
Figure 2.14 Executing a SimpleFunctionTool involves validating the parameter data of the ToolCall object and subsequently delegating to the wrapped function.

The diagram summarizes argument validation followed by delegation to the wrapped function. section 2.2.1
