create_agent_tool
Adds an HTTP/API tool to a Convocore agent, letting you define inputs, request mapping, and optional start-node attachment so the model can call it.
Instructions
Add an HTTP/API tool to a Convocore agent. Requires tool.name + tool.description. INPUTS — either (a) tool.variablesIds: ids of existing agent variables (create_agent_variable first), or (b) tool.fields[]: each entry needs key (the argument name — NOT "name"), type (string|number|boolean), in (body|query|header|path), plus description and required. REQUEST — simple tools: method + serverUrl (inputs are sent by their "in" location). Exact request shape: tool.httpRequest = { enabled: true, method, url, headers, query, bodyType: "json", bodyTemplate, bodyTemplateMode: "exact" }. In bodyTemplate/headers/query/url reference a variable with {{var:VARIABLE_ID}}; a value that is only that token keeps its number/boolean type. Fixed values are written literally. SECRETS — store an API key as an environment variable (create_agent_variable with isEnv: true; the value lives in defaultValue) and reference it with {{var:ID}}. Env variables must NOT be listed in variablesIds: they are resolved automatically and never shown to the model. An unfilled optional input sends its defaultValue; an input with no value and no default blocks the call with "Unresolved request values". By default the new tool is attached to the start node (nodes[].toolsIds) so the model can call it; pass attachToStartNode: false to skip. Verify with test_agent_tool_request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | Tool definition: name, description, method, serverUrl, serverUrlSecret, variablesIds[] or fields[] ({key,type,in,description,required}), httpRequest{enabled,method,url,headers,query,bodyType,bodyTemplate,bodyTemplateMode}, channels[], etc. | |
| agentId | Yes | ||
| attachToStartNode | No | Default true: adds the new tool id to the start node toolsIds so the agent can call it. A tool that is not in any node toolsIds is never offered to the model. |