Tool Spec Format Reference
The Tool Spec is the intermediate YAML format that sits between your source material and the generated TypeScript. Every generation path — OpenAPI, natural language — produces a Tool Spec. You can also write one by hand. Forge validates every Tool Spec against a Zod schema before generation. Invalid specs produce clear error messages pointing to the offending field.Complete Annotated Example
Top-Level Fields
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Identifier for this tool set (e.g. zendesk, billing, datadog). Used for file naming and collision prefixing. |
version | string | No | Version of this tool spec. Informational only. |
base_url | string | No | Base URL for all HTTP tools. Can reference env vars: ${ZENDESK_BASE_URL}. |
auth | AuthConfig | No | Default auth configuration applied to all tools unless overridden. |
tools | ToolDef[] | Yes | Array of tool definitions. |
triggers | TriggerDef[] | No | Array of trigger definitions. |
Tool Definition
Each entry in thetools array defines one agent capability.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique identifier. Use snake_case. |
description | string | Yes | What this tool does. The LLM reads this. |
method | string | No | HTTP method (GET, POST, PUT, PATCH, DELETE). Omit for non-HTTP tools. |
path | string | No | URL path, relative to base_url. Use {param} for path parameters. |
params | FieldDef[] | No | Query parameters and path parameters. |
body | FieldDef[] | No | Request body fields. |
auth | AuthConfig | No | Override the top-level auth for this specific tool. |
When to use params vs body
params— fields sent as URL query parameters or interpolated into the path.body— fields sent in the JSON request body.
GET and DELETE, use params. For POST, PUT, and PATCH, use body for the payload and params for path/query parameters.
Field Definition
Each entry inparams or body is a FieldDef:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Field name. |
type | string | Yes | One of: string, number, integer, boolean, array, object. |
required | boolean | No | Whether this field is required. Default: false. |
description | string | Yes | What this field represents. The LLM reads this. |
default | any | No | Default value if not provided. |
enum | string[] | No | Allowed values (for string type). |
items | FieldDef | No | Element definition for array type fields. |
properties | FieldDef[] | No | Nested field definitions for object type fields. |
Array fields
Nested object fields
Auth Configuration
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | One of: bearer, api_key, basic, oauth2, none. |
env | string | No | Environment variable name for the credential. |
header | string | No | Custom header name (for api_key type). Default: Authorization. |
bearer
Authorization: Bearer ${process.env.ZENDESK_API_TOKEN} to requests.
api_key
basic
JIRA_PASSWORD env var (the env value with _USERNAME replaced by _PASSWORD). Generated code encodes them as Basic base64(user:pass).
oauth2
SLACK_CLIENT_SECRET, SLACK_TOKEN_URL, SLACK_REDIRECT_URI. The generated code includes a token refresh flow.
none
Trigger Definitions
Triggers define how external events invoke agent capabilities.webhook
| Field | Type | Required | Description |
|---|---|---|---|
type | "webhook" | Yes | |
name | string | Yes | Trigger identifier. |
description | string | Yes | What this trigger does. |
path | string | Yes | The HTTP path to register (e.g. /webhooks/zendesk/ticket). |
event | string | No | Event name for documentation/logging. |
secret_env | string | No | Env var holding the webhook signing secret for verification. |
schedule
| Field | Type | Required | Description |
|---|---|---|---|
type | "schedule" | Yes | |
name | string | Yes | Trigger identifier. |
description | string | Yes | What this trigger does. |
cron | string | Yes | Cron expression (e.g. "*/15 * * * *"). |
emit
| Field | Type | Required | Description |
|---|---|---|---|
type | "emit" | Yes | |
name | string | Yes | Trigger identifier. |
description | string | Yes | What this trigger does. |
event | string | Yes | The event name to emit on the Svantic mesh. |
queue
| Field | Type | Required | Description |
|---|---|---|---|
type | "queue" | Yes | |
name | string | Yes | Trigger identifier. |
description | string | Yes | What this trigger does. |
queue_url | string | Yes | SQS/Redis/RabbitMQ queue URL. |
queue_env | string | No | Env var for the queue connection string. |
file
| Field | Type | Required | Description |
|---|---|---|---|
type | "file" | Yes | |
name | string | Yes | Trigger identifier. |
description | string | Yes | What this trigger does. |
watch_path | string | Yes | Directory or glob to watch for file changes. |
events | string[] | No | File events to react to: create, modify, delete. Default: all. |
