Define and customize tools
Letta has a native integration with Composio, which supports over 7000 pre-made tools to connect with popular services such as Slack, GitHub, Discord, etc. You can also create your own custom tools from scratch using Python.
Default Letta Tools
By default, agents in Letta are created with the following tools:
Custom Tools
You can create custom tools in Letta in Python. When you define the function for the tool, you must make sure to have a properly formatting docstring for Letta to parse the function schema.
Adding tools to agents in the Python SDK
Once the tool is created, you can add it to an agent by passing the tool name to the tools
parameter in the agent creation.
Tool Environment Variables
You can set agent-scoped environment variables for your tools. These environment variables will be accessible in the sandboxed environment that any of the agent tools are run in.
For example, if you define a custom tool that requires an API key to run (e.g. EXAMPLE_TOOL_API_KEY
), you can set the variable at time of agent creation by using the tool_exec_environment_variables
parameter:
External Tool Libraries
Letta also has early support for adding tools from the external tool library Composio. This integrations works by converting the external library tools into Letta tools.
For more information on setting up Composio tools, see our Composio guide.
Excluding Default Tools
To skip adding default tools when creating a new agent, you can add in include_default_tools=False
to the agent creation:
Warning: this will create an agent with no tools, so the agent will have no ability to manage memory or search conversation history.
Tool Rules
Tool rules allow you to define graph-like constrains on your tools, such as requiring that a tool terminate agent execution or be followed by another tool.
Read more about tool rules here.