Tools

Define HTTP tools the model can call, wire authentication from secrets, require confirmation, act as the user, and test them.

+ New HTTP tool creates a draft named new_tool and opens the editor. The list shows the request (GET https://…), the environment variables it uses (a red chip when one is not set in the selected environment), auth, flags (confirm, as user, side effect), which agents use it, and status. The Variables tab next to the list holds the per-environment values.

Fields

FieldNotes
Namesnake_case; this is the function name the model calls.
Statusdraft, published, archived. Only published tools are offered to agents; archived ones are removed from prompts.
Description for the modelSay when to call it and what it returns. This drives tool choice.
Method, URLGET, POST, PUT, PATCH, DELETE. A fixed URL works as is; a template such as {{ env.API_BASE }}/orders/{{ input.orderId }}/shipment resolves env.* from the environment’s variables and input.* from the model. Typing {{ opens suggestions. Only http(s), no private hosts, redirects are not followed.
Headers, QueryJSON objects; values may use {{ env.* }}, {{ input.* }}, {{ context.* }}, {{ user.* }} and {{ call.id }}.
Body templateFor non-GET methods. Rendered as JSON when parseable; content-type: application/json is set.
AuthNone · Bearer (secret) · API-key header (secret, header name default X-Api-Key) · Basic (secret holding user:pass). Secrets are referenced by name and decrypted only at call time.
Input schemaJSON Schema of the arguments. additionalProperties: false recommended. Validated before every call (required, type, enum).
Timeout, Retries, BackoffTimeout up to 15 s (default 8 s); up to 3 retries on network errors and 5xx.
Requires confirmationThe user approves the call in the chat first (tool.confirmation_required).
Acts as the end userForwards the user’s own JWT in a header (default X-User-Token) so your API applies its normal permissions. Works on every turn, not only the first — WebSocket and SSE both carry the token with every message, and it is kept across reconnects. If the token’s exp has passed mid-conversation the call is skipped and fails with auth_expired instead of sending your API a stale bearer.
Has side effectsMarker for calls that should never run speculatively.

Output to the model

By default the model reads the endpoint’s whole JSON response, cut to 12,000 characters. The Output to the model section on each tool (below Timeout, Retries, Backoff) narrows that with a Projection — a small path expression — and lets you raise or lower the Max characters cap (default 12,000).

Projection examples:

  • items[:10].{id,title,distanceKm} — the first 10 elements of items, each reduced to those three keys.
  • {line, data.events[:10]{id,title,venue{name}}} — a new object: line is copied as is, events holds the first 10 of data.events, each reduced to id, title and a venue object with only name. The last path segment of a field becomes its key in the result.
  • nested.array[3] — a single element (not wrapped in an array).

A path segment is a key; [:N] keeps the first N of an array; [N] picks one element; {a,b} keeps only those keys, on an object or on each element of an array.

This only narrows what the model reads — the runtime still uses the full response for workflow render_ui nodes and $item card references, whatever the projection drops. Leave Projection empty to send everything up to the character cap.

The Test button shows a What the model sees block, with the character count, above the raw Response, so you can check a projection before publishing; an invalid expression shows a projection error there instead.

Variables

One tool definition serves both environments: write {{ env.NAME }} where the value differs and set the values on the Variables tab, one column per environment. The usual case is a base URL:

Namedevelopmentproduction
API_BASEhttps://api-dev.acme.comhttps://api.acme.com

with tool URLs like {{ env.API_BASE }}/orders/{{ input.orderId }}. Your app only switches its publishable key; the runtime picks the variables of the key’s environment. Variables work in tool URLs, headers, query and body, in workflow node templates, and in the system prompt.

Rules: names are letters, digits and underscores and cannot start with a digit; values are plain text (at most 4 KB, 100 per environment) and visible to every member, so API keys belong in Secrets instead. An empty cell means not set: a tool that references the variable refuses to run in that environment with environment variable API_BASE not set in this environment (visible in the conversation inspector) rather than calling a half-built URL. The Variables tab shows which tools use each variable.

Test

The Test in development / production button runs the tool from the runtime with the sample JSON (pre-filled from the schema) and the variables of the environment selected in the top bar. It shows status, duration, the request with secrets redacted (including the resolved URL and the variables used), the projected body when a projection is configured, and the raw response body. Use it before attaching a tool to an agent.

Templates

{{ input.orderId }} reads the model’s argument; {{ context.locale }} reads the session context; {{ user.externalId }} and {{ user.anonymous }} read the trusted end user of the conversation (from the verified session/auth-frame token, never from client-controlled context); {{ call.id }} is this tool call’s id, typically used as Idempotency-Key on a write. Unknown paths render as empty strings. Dotted paths only; no expressions.

The Acme sample tools

A fresh workspace ships five tools pointed at the demo backend so a real model has something to call:

ToolRequestConfirmation
search_productsGET https://api.kletso.ai/demo/acme/products?q={{ input.query }}&maxPrice={{ input.maxPrice }}no
search_flightsGET https://api.kletso.ai/demo/acme/flights?from={{ input.from }}&to={{ input.to }}&date={{ input.date }}no
track_shipmentGET https://api.kletso.ai/demo/acme/orders/{{ input.orderId }}/shipmentno
get_salesGET https://api.kletso.ai/demo/acme/reports/sales?period={{ input.period }}no
cancel_orderPOST https://api.kletso.ai/demo/acme/orders/{{ input.orderId }}/cancelyes

Replace the URLs with your own endpoints when you are ready; the schemas are a good starting point.

Status line

For agents with the Fast path on, a tool’s Status line is streamed as the first line of the reply the moment Jev names the tool, before the model speaks. It is a template over the arguments and the context, for example Searching products for {{ input.query }}…. Leave it empty for no line.

Last updated 2026-09-28 · Report an issue with this page