Custom Tools
Custom Tools
Custom tools extend what your AI can do. Describe what you need in plain language, your AI builds it, you review and approve it, then it becomes a tool your AI can use in any conversation.
How It Works
- Describe — Tell your AI what you need: "build me a tool that creates GitHub issues"
- AI builds — Your AI generates the tool definition and code
- It's live — The tool is active immediately and available in every conversation
- Configure — Choose visibility, scheduling, email triggers, and more
All custom tool operations use the tool tool with an action parameter.
Aliases
Old tool names like create_dynamic_tool and create_code_tool still work but are deprecated. Use tool(action="create", ...) instead.
Tool Types
| Type | Name | What It Does |
|---|---|---|
http_proxy | Service Connectors | Call external APIs with templated URLs, headers, and auth |
transform | Data Transforms | Reshape and extract data using JSONata expressions |
chain | Workflow Chains | Run multiple tools in sequence as a single action |
code | Code Tools | Run custom JavaScript in secure, isolated containers |
skill_backed | Skill-Backed | Tools powered by approved Kyew skills |
Quick Examples
Service Connector (http_proxy)
Connect to any API with templated requests:
tool(action="create",
name="github_create_issue",
description="Create an issue in a GitHub repository",
tool_type="http_proxy",
input_schema={
type: "object",
properties: {
owner: { type: "string" },
repo: { type: "string" },
title: { type: "string" }
},
required: ["owner", "repo", "title"]
},
http_config={
method: "POST",
url_template: "https://api.github.com/repos/{{owner}}/{{repo}}/issues",
body_template: { title: "{{title}}" },
connection_id: "my-github-connection"
})
See Service Connectors for the full guide.
Data Transform (transform)
Reshape data with JSONata expressions:
tool(action="create",
name="calculate_discount",
description="Calculate discounted price",
tool_type="transform",
input_schema={
type: "object",
properties: {
price: { type: "number" },
discount_percent: { type: "number" }
},
required: ["price", "discount_percent"]
},
transform_config={
expression: "input.price * (1 - input.discount_percent / 100)"
})
See Data Transforms for the full guide.
Workflow Chain (chain)
Run multiple tools in sequence:
tool(action="create",
name="deploy_and_notify",
description="Deploy to production and notify the team",
tool_type="chain",
input_schema={
type: "object",
properties: {
environment: { type: "string" },
message: { type: "string" }
},
required: ["environment"]
},
chain_config={
steps: [
{ tool_name: "cloudflare_deploy", input_mapping: { env: "{{environment}}" } },
{ tool_name: "slack_notify", input_mapping: { channel: "#deploys", text: "Deployed to {{environment}}: {{message}}" } }
]
})
See Workflow Chains for the full guide.
Code Tool (code)
Run custom JavaScript in isolated containers:
tool(action="create",
name="calculate_statistics",
description="Calculate statistical measures for a list of numbers",
tool_type="code",
input_schema={
type: "object",
properties: {
numbers: { type: "array", items: { type: "number" } }
},
required: ["numbers"]
},
code_config={
code: "export default { async fetch(request) { const { numbers } = await request.json(); const mean = numbers.reduce((a, b) => a + b, 0) / numbers.length; return Response.json({ mean, count: numbers.length }); } }",
runtime: "javascript",
allowed_domains: []
})
See Code Tools for the full guide.
Skill-Backed (skill_backed)
Tools powered by approved Kyew skills:
tool(action="create",
name="weekly_report",
description="Generate a weekly report from my memories",
tool_type="skill_backed",
skill_id="skill_abc123")
Managing Tools
List Your Tools
tool(action="list")
tool(action="list", status="active")
tool(action="list", tool_type="code")
Get Tool Details
tool(action="get", tool_id="tool_abc123")
Update a Tool
tool(action="update", tool_id="tool_abc123", description="Updated description", status="active")
Delete a Tool
tool(action="delete", tool_id="tool_abc123")
Test a Tool
tool(action="test", tool_id="tool_abc123", test_input={ numbers: [1, 2, 3] })
Tool Status
| Status | Description |
|---|---|
active | Available for use in conversations. This is the default. |
disabled | Temporarily turned off. Can be re-activated. |
Tools are active by default when created.
Tool Visibility
Control whether a tool appears in your AI's tool list:
| Visibility | Description |
|---|---|
exposed | Appears in tools/list every session. This is the default. |
unlisted | Callable by name, but hidden from the manifest. Reduces context bloat. |
Toggle visibility anytime:
tool(action="update", tool_id="tool_abc123", visibility="unlisted")
See Tool Visibility for details.
Connections
Custom tools that call external APIs need credentials. Connections store API keys, OAuth tokens, and other credentials securely. Create a connection once, reference it in any number of tools.
Scheduling
Schedule code tools to run automatically at specific hours with optional email summaries.
Per-User Database
Code tools get access to a per-user SQLite database (10 GB) for persistent storage. See the Database Guide for patterns and usage.
API Reference
For the full technical reference including all parameters and options, see tool Tool Reference.