The tool input defines what a caller must send to the tool: a JSON schema that every incoming record is validated against, plus mock data you use to preview and test the tool. This article walks integrator.io users through the Define tool input editor — naming the step, building the schema, supplying mock input, setting an optional trace key template, previewing the result, and adding a transformation. For the schema editor's types, validations, and modes in detail, see Tool schema and validation reference.
Prerequisites: Create a tool.
Define the input
- Go to AI studio
, and then select Tools.
- Select the tool, and then select Tool input on the canvas. The Define tool input editor opens.
- Under General, enter Name your tool input and a Description. The name replaces the placeholder
inputon the canvas. - Under Create schema, choose Manual to build the schema visually or JSON to write JSON Schema. Switching from JSON to Manual removes keywords Manual mode doesn't support, after a confirmation. For when to use each mode, see Tool schema and validation reference.
- In Manual mode, select Create record { } to add a property, then enter its name and select its type at the left of the row. Point to any row to view and modify validation settings, add a child property, and delete the property.
Supply mock input
Mock input is the sample record the tool uses when you preview a step or run a test. The Mock tool input tab is populated from the schema automatically; edit it to use values that exercise your logic.
- Mock input must be valid JSON. Invalid JSON is rejected.
- Mock input is stored with the tool permanently. Don't use personal or sensitive data.
- Reset to sample data regenerates the mock input from the schema and discards your edits.
Set a trace key template
Under General, enter a Trace key template to tag each invocation with a value from the record — for example, an order number — using handlebars (select { } to insert a field). The value appears in the Trace key column of the tool's Logs tab, so you can find a specific record's run. The template is optional. See View tool invocation logs.
Preview the input
Select Preview, and then select Send. The Input tab shows the mock record and the Output tab shows what the next step receives. If the mock input doesn't match the schema, a validation error names the property that failed.
Add a transformation
A transformation restructures the input — renaming, removing, or nesting fields — before the next step sees it. On the canvas, select More ... on the Tool input step, and then select Transformation (available once the tool input is configured). The Define transformation editor opens on Rules 2.0; Rules 1.0 and JavaScript are the other options. In a rule, Input is the source field and Output is the new field name; rules run in order, and you can drag them to reorder. For the editor itself, see Transformations.