Custom Tool Editor
Edit workspace custom tools.
Overview
| Property | Value |
|---|---|
| Key | editor_custom_tool |
| Category | Editor |
The Custom Tool Editor lets you define and modify custom tools that agents can call during workflows. Each tool has two parts: a JSON schema that declares the tool's name, description, and parameters, and a JavaScript function body that runs when the tool is invoked. Use the Custom Tool List widget to browse, create, and import tools; the editor is the primary workspace for authoring their logic.
Features
- Two-section layout toggled by Config and Code tabs in the header bar.
- Config section provides a Monaco JSON editor for the OpenAI function-calling schema format. The schema must include
type: "function", afunction.name,function.description, andfunction.parameterswithtype,properties, andrequired. Real-time validation highlights errors as you type. - Code section provides a Monaco JavaScript editor for the tool's function body. The code runs inside an
async function(params, environmentVariables)context. Reference input parameters with<paramName>syntax and environment variables with{{VAR_NAME}}syntax. - AI wand on both sections lets you describe what you want in plain English and streams generated JSON schema or JavaScript code directly into the editor.
- Schema parameter autocomplete in the code editor automatically suggests parameter names derived from the JSON schema as you type.
- Environment variable dropdown triggers on the
{{pattern, letting you insert workspace secrets. - Tag dropdown triggers on the tag pattern, letting you reference workflow variables.
- Export button in the header bar downloads the current custom tool as TradingGoose export JSON.
- Save button validates the schema, checks for duplicate tool names, and persists both schema and code. If validation fails, the editor switches to the Config section and shows the error.
- Tool selector in the header bar switches between custom tools. When paired via a color link, it syncs with the Custom Tool List widget.
Usage
- Add the widget to a workspace from the widget picker.
- Select an existing custom tool from the header dropdown, or create/import one from the Custom Tool List widget.
- In the Config tab, write or generate the JSON schema defining the tool's name, description, and parameters.
- Switch to the Code tab and write the JavaScript function body. Use parameter names from the schema directly -- the code editor will autocomplete them.
- Click Save to persist the tool. The editor validates the schema first and shows any errors inline.
Schema Format
The JSON schema must follow the OpenAI function-calling format:
{
"type": "function",
"function": {
"name": "myToolName",
"description": "What the tool does.",
"parameters": {
"type": "object",
"properties": {
"paramName": {
"type": "string",
"description": "What this parameter is for."
}
},
"required": ["paramName"]
}
}
}Custom tools exported from the editor use the shared TradingGoose export JSON format. If you import tools through the Custom Tool List widget, duplicate titles and function names are renamed automatically before the editor opens them.
This widget supports the pairColor mechanism. Assign the same color to a Custom Tool Editor and a Custom Tool List widget so that selecting a tool in the list automatically opens it in the editor.
Configuration
The selected tool is stored in widget params as customToolId and synced through the pair-color store when linked. The active section (Config or Code) is synchronized across header tabs and the editor body via custom events.