Skip to content

HTTP tools and secrets ​

An HTTP tool lets an agent call an API of yours during a run: look up an order, create a ticket, check availability. You define the request once per project; the model decides when to call it and fills in the parameters.

Defining a tool ​

Tools are created in the console (Project → Tools). A tool has:

FieldRules
namewhat the model sees: letters, digits, _ and -, starting with a letter, up to 64 chars
descriptionwhen and why to use it (the model reads this; be specific), up to 2000 chars
configthe request template and response handling, below

config:

FieldDefaultMeaning
methodGETGET, POST, PUT, PATCH, DELETE
urlURL template
headers{}header templates
query{}query parameter templates
bodybody template (string)
parameters{"type": "object", "properties": {}}JSON Schema of the arguments the model fills
responsePathdotted path into the JSON response (data.items.0); empty = whole body
maxResponseBytes20 000the response is truncated to this size (100 to 1 000 000)
timeoutMs10 0001 000 to 30 000

Placeholders ​

  • {{param}} is a tool argument. It is URL-encoded in url and query, inserted raw in headers, and JSON-encoded in body: write {"q": {{q}}} or {"q": "{{q}}"}.
  • {{secret:NAME}} is a project secret, inserted raw (JSON-escaped inside body).

Example: look up an order.

json
{
  "name": "get_order",
  "description": "Returns status, items and tracking number of a customer's order by order number.",
  "config": {
    "method": "GET",
    "url": "https://shop.example.com/api/orders/{{orderNumber}}",
    "headers": { "Authorization": "Bearer {{secret:SHOP_API_TOKEN}}" },
    "parameters": {
      "type": "object",
      "properties": {
        "orderNumber": { "type": "string", "description": "Order number such as A-1001" }
      },
      "required": ["orderNumber"]
    },
    "responsePath": "data"
  }
}

The console has a Test button that calls the tool with arguments you enter and shows the status, the (truncated) body and whether it was truncated.

Attaching it ​

Add the tool to an agent's tools:

json
{ "tools": [{ "kind": "http", "toolId": "…" }], "maxToolCalls": 10 }

maxToolCalls (0 to 50, default 10) caps the number of tool calls in one run.

Secrets ​

Secrets keep credentials out of agent and tool configurations. They belong to a project, are managed by admins in the console (Project → Secrets), are stored encrypted and can never be read back, only replaced or deleted. Reference them as {{secret:NAME}} in HTTP tools, http_api data sources and workflow HTTP nodes (header values).

A reference to a secret that does not exist fails the call with SECRET_MISSING.

Secrets only go to a fixed host ​

When a request uses a secret anywhere (URL, query, headers or body), its URL must start with a literal scheme, host and port: placeholders are allowed only in the path and the query. This keeps a prompt-injected end user from steering the model into sending your credentials to a host of their choice.

URL templateWith a secret
https://shop.example.com/api/orders/{{id}}allowed
https://shop.example.com/search?q={{q}}allowed
https://{{host}}/api/ordersrefused: 400 SECRET_ORIGIN_NOT_FIXED
https://shop.example.com{{path}}refused (the host could be extended)
https://api.{{region}}.example.com/xrefused

The check runs when a tool or http_api data source is created or updated (the error names the field: config.url or config.request.url), and again before each request is sent: a request with secrets whose final origin differs from the template's is refused with SECRET_ORIGIN_CHANGED. Without secrets, a dynamic host is allowed.

What the model sees ​

The tool call's result is the parsed JSON response (after responsePath) or its text, truncated to maxResponseBytes. Every call is recorded on the run in toolCalls:

json
{
  "toolCalls": [
    {
      "name": "get_order",
      "args": { "orderNumber": "A-1001" },
      "ok": true,
      "result": { "status": "shipped", "tracking": "1Z…" }
    }
  ]
}

Streams emit tool.call and tool.result events (see Streaming).

Network safety ​

All outbound requests (tools, crawlers, HTTP sources, webhooks, workflow HTTP nodes) go through one client that blocks private, loopback and link-local addresses (with a DNS rebinding check), enforces timeouts and limits response sizes. Your API must be reachable on the public internet.

Built-in tools ​

No configuration needed; add them with { "kind": "builtin", "name": "…" }:

NameDoes
current_timecurrent date and time in UTC and, optionally, an IANA time zone
detect_languagelanguage of a text: ISO 639-1 code, name and confidence
web_fetchfetches a public http(s) page: {url, finalUrl, status, title, mimeType, text, truncated}

web_fetch goes through the same protected client as HTTP tools (public addresses only, checked redirects, timeouts and size limits). It extracts the page's main content (PDFs and office files too) and cuts the text at 20 000 characters (truncated: true). A page that cannot be fetched or read is reported to the model as a tool error.

Hevkar public API v1