Description
The Toolbox View enables users to create custom tools for design agents to use. Toolboxes function follows the MCP format that expose specific functionality through defined interfaces. The view consists of three panes: the left pane contains the summary. The middle pane contains the code editor. The right pane serves as the testing area.
Creating Custom Tools
Toolboxes allow you to create specialized functions that design agents can use to accomplish tasks. Each toolbox can expose multiple tools, each with specific parameters and functionality. For example, you might create a WeatherDataTool that provides weather alerts and forecasts by interacting with external APIs.Tool Structure
A typical toolbox contains:- Constants and Configuration - API endpoints, credentials, etc.
- Helper Functions - Functions that support the main tool operations
- Tool Functions - The actual functions exposed to agents which are marked with the
davinci.tool()decorator. - Documentation - Clear descriptions of what the toolbox as a whole does and its purpose.
- Status - Toggle to enable/disable the toolbox from the agent access. All active tools can be seen in the project area under the tools section.
Code Editor
The code editor enables you to modify tool code, and all changes are automatically saved as you edit. It works just like the normal code editor in Davinci. For more information about code editor operations, see the Code Editor documentation.Testing Tools
The testing area allows you to validate your tool’s functionality. Enter test instructions in the input field and click theRun Test button to execute your tool with those parameters. The output will show the results of your tool execution.
Thoroughly test your tools with different inputs to ensure they handle errors gracefully and return expected results. Once ready toggle the status to enable the tool for the agent to use.
Example
Below is an example of a toolbox that provides weather information from the National Weather Service API:davinci.tool() decorator. This decorator is used to mark the function as a tool. The list on the left panel will display each tool as gathered by the decorators.
This toolbox could be used by design agents to fetch and format weather data for various locations. To have data passed directly from the tool to the database, you can use the save() and update() functions as in regular code.