# InTouch IML Tool Reference Authoring an IML tool: the complete field reference — tool metadata, the `credential` block and its `properties`, `input` property types, `steps` and their fields, and `publish` outputs. An IML tool is a self-contained automation unit defined in a single `tool.iml` file; it can be installed, run on demand, used as a task type inside workflows, and invoked by the AI assistant. ## Directory Structure Each tool lives in its own folder under `tools/installed/`: ``` tools/installed/my-tool/ ├── tool.iml # Tool definition (required) ├── fetch_data.py # Python scripts (if using python steps) ├── README.md # Documentation (optional, shown via Help button) └── help.html # Custom help page (optional, overrides README) ``` ## Tool Definition (`tool.iml`) ```json { "name": "my-tool", "displayName": "My Tool", "version": "1.0.0", "vendor": "Acme Corp", "description": "What this tool does", "assistantDescription": "", "credentialBased": false, "maxTime": 0, "credential": { "properties": { "apiKey": { "type": "password", "description": "API key", "required": true }, "server": { "type": "string", "description": "Server hostname", "default": "api.example.com" } } }, "input": { "query": { "type": "string", "required": true, "description": "Search query" }, "maxResults": { "type": "number", "default": "10", "description": "Maximum results to return" }, "verbose": { "type": "boolean", "default": "false" } }, "steps": [ { "name": "step-one", "type": "http", "output": { "myField": "$.data.value" } }, { "name": "step-two", "type": "python" } ], "publish": { "result": "{{step-one.myField}}", "detail": "{{step-two.parsed}}" } } ``` IML is JSON, so it carries no inline comments. What each field means: | Field | Meaning | |---|---| | `name` | Unique lowercase name (**required**) | | `displayName` | Human-friendly name shown in the UI | | `assistantDescription` | If set, the AI assistant can invoke this tool directly | | `credentialBased` | `true` if the tool needs credentials (API keys, DB logins, …) | | `maxTime` | Max execution time in seconds (`0` = unlimited) | | `credential` | Only present when `credentialBased` is `true` | | `input` | Parameters supplied at runtime | | `steps` | Execution steps, run in order; each step's `output` extracts values from its response | | `publish` | Final tool outputs, available to downstream tasks | For a long-form note inside a definition, use the top-level `comment` field — an array of strings — rather than trying to comment a line. ### Input Property Types | Type | Description | Example Default | |------|-------------|-----------------| | `string` | Text value | `"hello"` | | `password` | Secret text (masked in UI) | — | | `number` | Numeric value | `"10"` | | `boolean` | true/false | `"false"` | --- ## Variable Resolution Variables are resolved before each step executes. | Syntax | Source | Example | |--------|--------|---------| | `{{input.name}}` | Input parameter | `{{input.query}}` | | `{{credential.name}}` | Credential property | `{{credential.apiKey}}` | | `{{stepName.field}}` | Output from a prior step | `{{fetch.body}}` | | `{{env.VAR_NAME}}` | Environment variable | `{{env.HOME}}` | The special input `{{input._skillDir}}` is automatically injected — it contains the absolute path to the tool's install directory. Useful for Python scripts that need to access files bundled with the tool. --- ## Step Types ### http Makes an HTTP request. ```json [ { "name": "call-api", "type": "http", "method": "GET", "url": "https://api.example.com/data?q={{input.query}}", "contentType": "application/json", "body": "{\"key\": \"value\"}", "headers": { "X-Custom": "value" }, "auth": { "type": "bearer", "token": "{{credential.apiKey}}" }, "successCodes": [ 200, 201 ], "output": { "status": "$._status", "body": "$._body", "value": "$.data.items[0].name" } } ] ``` **Auto-outputs:** `_status`, `_body` **JSONPath support:** `$.field`, `$.field.subfield`, `$.array[0]`, `$[*].field` --- ### python Runs a Python script bundled with the tool. ```json [ { "name": "process-data", "type": "python", "script": "my_script.py", "args": "{{input.tickers}}", "workingDir": "/tmp", "timeout": 60, "successExitCodes": [ 0 ], "output": { "parsed": "$.result" } } ] ``` **How it works:** 1. InTouch writes a temp JSON context file containing `input`, `credential`, and `steps` data 2. Runs: `python3