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
Tool Definition
Each entry in thetools array defines one agent capability.
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:
Array fields
Nested object fields
Auth Configuration
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.
