Skip to main content
Each tool in a ToolSet is an individual executable unit with a defined input schema, output schema, and code. The console provides a full-featured development environment for writing, testing, and iterating on tools without leaving the browser.

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. Export input and output schemas and an async run function:
Key conventions for TypeScript tools:
  • Import z from "zod" — it is pre-installed in the sandbox.
  • Export input and output as Zod schemas. These are used for validation and to generate JSON Schema for the API.
  • Export run as the entry point. It receives the validated input and must return an object matching the output schema.
  • You can import any 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. Define Input and Output models and a run function:
Key conventions for Python tools:
  • Define Input and Output as Pydantic BaseModel subclasses.
  • Define run as the entry point. It receives the validated input and must return an instance of the Output model.
  • You can import any packages listed in the ToolSet’s Packages tab.
  • Environment variables are accessible via os.environ.

Input and Output Schemas

Schemas serve two purposes:
  1. Validation — The API validates the input (required fields and property types) against the input schema before execution. The output is not validated.
  2. Documentation — Schemas are exposed through the API and MCP endpoints so that AI agents understand what a tool expects and returns.
Both schemas are extracted from your code: when you save a tool, the API runs the 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.
This uses AI to analyze your code and saves time when you have already written the implementation.

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 with Cmd/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.
Be specific about libraries and expected behaviour, build complex tools incrementally, and continue an existing conversation rather than starting over when iterating.

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 copyable curl example whose sample input is generated from the tool’s input schema.
  • The Public Endpoint (POST .../v1/public/{orgId}/{slug}/run/{toolSlug}) with its curl example when the ToolSet is public, or a note that the ToolSet is private.
  • A reminder that each execution consumes 1 credit.
The MCP endpoint is shown on the ToolSet’s Tools tab, not in this panel. This is useful for quickly integrating a tool into external applications while still in the editor.

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.