Creating a Tool
1
Open the ToolSet
Navigate to the ToolSet where you want to add a tool. Make sure you are on the Tools tab.
2
Click Add Tool
Click Add Tool. A Create New Tool modal will ask for:
- Name — Human-readable name (e.g. “Post Message”).
- Slug — URL-safe identifier (e.g.
post-message), auto-generated from the name. Used in API endpoints. - Description — What the tool does (optional).
3
Open the Editor
Click Create Tool. You are redirected to the Tool Editor page with a language-appropriate starter template pre-filled.
The Tool Editor
The Tool Editor is a resizable, multi-panel workspace:Code Editor
A CodeMirror-based editor with syntax highlighting for TypeScript and Python.
Test Panel
Enter JSON input and run the tool in a live sandbox. View the output or error without leaving the editor.
Settings Panel
Edit the tool’s name, slug, and description. Trigger auto-fill of metadata from code.
AI Copilot
A built-in chat assistant that can generate code, suggest fixes based on execution output, and update test inputs.
Keyboard Shortcuts
Writing Tools in TypeScript
TypeScript tools use Zod for schema definitions. Exportinput and output schemas and an async run function:
- Import
zfrom"zod"— it is pre-installed in the sandbox. - Export
inputandoutputas Zod schemas. These are used for validation and to generate JSON Schema for the API. - Export
runas the entry point. It receives the validated input and must return an object matching the output schema. - You can
importany packages listed in the ToolSet’s Packages tab. - Environment variables are accessible via
process.env.
Writing Tools in Python
Python tools use Pydantic for schema definitions. DefineInput and Output models and a run function:
- Define
InputandOutputas PydanticBaseModelsubclasses. - Define
runas the entry point. It receives the validated input and must return an instance of theOutputmodel. - You can
importany packages listed in the ToolSet’s Packages tab. - Environment variables are accessible via
os.environ.
Input and Output Schemas
Schemas serve two purposes:- Validation — The API validates the input (required fields and property types) against the input schema before execution. The output is not validated.
- Documentation — Schemas are exposed through the API and MCP endpoints so that AI agents understand what a tool expects and returns.
input / output definitions (Zod or Pydantic) in a sandbox and stores the resulting JSON Schemas. A tool cannot be saved if input, output or run is missing.
Use .describe() (Zod) or Field(description=...) (Pydantic) on each field to provide clear descriptions. These descriptions appear in the API documentation and are used by AI agents to understand how to call your tool.
Auto-Generate Metadata
Click Auto-fill in the Settings panel to automatically fill in:- Name — a human-readable name inferred from the code.
- Slug — derived from the code.
- Description — a summary of what the tool does.
AI Copilot
The right-hand panel of the tool editor is an AI coding agent (its header reads Coding Agent) that knows the tool’s code, language and latest test result. It is open by default; toggle it withCmd/Ctrl + B, or reopen it with the bot icon (Open AI Assistant) that takes its place while it is closed.
Type a request into the Ask anything… box and press Enter (Shift + Enter inserts a newline). An empty conversation offers the starters Explain this code, Add error handling and Optimize performance. Typical requests:
- Generate or change code — The agent writes or edits the implementation. Changes it makes through its editing tools appear in the editor as they happen; for code shown in the chat, click Apply to put it into the editor, which also saves the tool. Copy copies the snippet instead.
- Fix a failed test — The latest run result (status, input, output, error, stdout and stderr) is sent with every message. After a failed test, an Auto Fix Error button appears that asks the agent to fix the error based on that result.
- Run and fill in test input — The agent can run the tool itself and can fill the Input tab of the Test panel with suggested test input, typically after a successful run.
- Conversations — Conversations are saved per tool and per user. The most recent one loads when the panel opens; the header has a conversation selector, New conversation and Export conversation.
API Panel
Toggle the API panel (Cmd/Ctrl + . or the API button in the header) to view:
- The Organization Endpoint (
POST .../v1/orgs/{orgId}/toolsets/{slug}/tools/{toolSlug}/run) with a copyablecurlexample whose sample input is generated from the tool’s input schema. - The Public Endpoint (
POST .../v1/public/{orgId}/{slug}/run/{toolSlug}) with itscurlexample when the ToolSet is public, or a note that the ToolSet is private. - A reminder that each execution consumes 1 credit.
Saving and Deleting
- Save — Click the Save button or press
Cmd/Ctrl + S. Changes are saved to the draft state and do not affect published versions. - Delete — Click the Delete button in the header. A confirmation dialog will appear. Deleting a tool removes it from the draft state. If it was included in published versions, those snapshots remain unchanged.
Best Practices
- Keep tools focused. Each tool should do one thing well. Use the ToolSet to group related tools.
- Write descriptive schemas. Good field descriptions help AI agents call your tools correctly.
- Test before publishing. Use the Test panel to verify behavior with various inputs before publishing a new version.
- Use environment variables for secrets. Never hard-code API keys or tokens in tool code. Store them in the ToolSet’s Environment tab.
- Leverage the Copilot for iteration. After a failed test run, the Copilot has access to the error output and can suggest targeted fixes.