Ready to give your AI agents superpowers? In just a few lines you can attach any Python or TypeScript function as a tool.
The Simple Version
Think of a tool as a special function that the agent can call.
You write the function, put it in your project, and tell the agent about it.
How It Actually Works
Define Your Tool
Create a function that does the work you need.
Make sure it follows the expected signature.
Import and Register
Put the function in agent.py.
Pass it to define_deep_agent so the system knows it exists.
Technical Deep Dive
Managed Deep Agents expects tools to be exported as objects in a tools dictionary.
Each entry maps a name to a callable that matches the Callable protocol.
You can also provide TypeScript definitions for front‑end integration.
The agent runtime serializes calls, sends them over the network, and returns results.
Why This Matters
Custom tools let you connect LLMs to databases, APIs, or hardware without rebuilding the whole stack.
Developers can reuse existing code, speeding up prototyping and production deployment.
This extensibility is key for building real‑world AI applications.
Key Takeaways
- Define a function that encapsulates the desired capability.
- Import it into
agent.py. - Pass the tool list to
define_deep_agent. - Tools can be written in Python or TypeScript.
- Managed Deep Agents handles the call‑remote‑execution plumbing.
- This pattern enables rich, interactive AI agents.
- Start small, then scale to complex workflows.