Skip to main content
Although the tool interface is straightforward and simple to use, there are actually quite a few practices and tricks that you can use to get significantly better results.

Provide Hints for the Agent

Based on your tool’s logic, you can provide hints for the agent in tool output on what to do next.

Use Shared State to Control the Tool Flow

Use agency context (previously shared state) to validate previous actions taken by this or other agents, before allowing it to proceed with the next action.

Use Special Types

Restrict the agent to only use specific values for a field, instead of letting it wander by itself.

Combine Multiple Methods

Combine multiple methods to make your execution flow more readable.

Include a Test Case

Include test cases at the bottom of each tool file.

Next Steps

We highly recommend you explore the resources provided in the Pydantic is all you need section.