Defining Tools in the UI
Four input methods:- Upload JSON —
.jsonfiles containing tool definitions (single tool or array). - Upload OpenAPI Spec —
.json,.yaml, or.ymlfiles in OpenAPI 3.x format. Operations are extracted as individual tools. - Paste JSON — paste tool definitions directly.
- Natural Language — describe tools in plain English; the teacher model compiles these into structured schemas.
OpenAPI Spec Format
Upload a standard OpenAPI 3.x spec and Spectra extracts each operation as a tool:.json, .yaml, and .yml files.
JSON Schema Format
Each tool is defined as a JSON object with a name, description, and parameter schema:During training, Spectra normalizes uploaded JSON schemas and natural-language tool descriptions into the same canonical tool definition before seed generation and reward compilation. In practice, that means your final tool name is normalized to
snake_case, and the model is trained against typed parameters plus explicit required fields rather than against the raw prose description.Natural Language Format
- Good examples
- What to avoid
Clear and detailed:Concise but complete:
Tips for Natural Language Schemas
- Be specific about parameters — include names, types, and constraints
- Specify constraints — formats (
LD-XXXX), enums (New, Contacted, Qualified), ranges (1-10), lengths (max 280 chars) - Indicate required vs optional — explicitly state which parameters are required
- One tool per description — describe a single tool per natural language entry
Pipeline Schema Methods
When using themechanex-train CLI or Cloud Run Jobs directly, tool schemas can be provided in several ways:
Environment Variable
UseTOOL_SCHEMAS_TEXT with pipe-separated descriptions:
Text File
Create a file with one schema per line:Config File
JSON Schema Directory
Place individual.json files in a directory:
Mixing Methods
All methods can be combined. The pipeline merges schemas from all sources:JSON vs Natural Language
Natural language schemas cost slightly more to process since the teacher model interprets the description during reward compilation. The difference is minimal (approximately $0.001 per schema).