Tools
Create, save, and execute reusable code blocks as tools in AVM.
Overview
In addition to one-off sandbox executions, AVM lets you save code blocks as reusable tools. Once you’ve finalized a working version of your code through sandbox runs, you can save it as a tool that agents can call repeatedly without having to regenerate or redeploy the code.
Tools provide several key benefits:
- Reusability: Invoke the same logic on-demand without regenerating code
- Versioning: Track and manage different versions of your tools
- Deterministic execution: Treat tools as callable functions within your agent’s toolset
- Collaboration: Make tools public for sharing across teams and organizations
Creating a Tool
After testing your code with sandbox runs, you can save it as a reusable tool. Tools are created with specific inputs, environment variables, and a code block that defines their functionality.
Tool Parameters
- name: A unique identifier for your tool
- description: Clear explanation of what the tool does
- isPublic: Whether the tool can be used by other users
- code: The Python code that will be executed
- inputs: Array of input parameters the tool expects
- envVariables: Array of environment variables the tool uses
- revisionName: Version identifier for tracking changes
Only Python code is supported at the moment by AVM tools. The inputs
and envVariables
fields are optional.
Executing Tools
Once a tool is saved, it can be re-executed anytime using the execute endpoint. This allows for consistent, repeatable execution of your code logic.
Tool Execution Response
The response includes structured output from your tool execution:
The outputs
section reflects the output dictionary defined in your code block, making it easy to pass structured data back to the calling agent or workflow.
Public Tools
Tools can be made public, allowing any agent to call them as part of their own toolchain. This enables:
- Shared utilities: Common logic available across teams
- Open collaboration: Community-driven tool development
- Reduced duplication: Reuse existing solutions instead of rebuilding
- Faster development: Agents can leverage pre-built functionality
When creating public tools, ensure your code doesn’t contain sensitive information or API keys. Use environment variables for any secrets or configuration.
Tool Versioning
Tools support versioning through the revisionName
field, allowing you to:
- Track changes over time
- Maintain backward compatibility
- Test new versions while keeping stable releases
- Reference specific versions in your workflows
Organizing Tools into Toolkits
For more complex workflows, tools can be grouped into toolkits — structured collections of reusable tools. Toolkits let agents compose multi-step behaviors from atomic building blocks and organize functionality into logical domains.
Tools must be created before they can be added to toolkits. Consider the relationship between your tools when designing your overall workflow architecture.