Skip to Content
almyty docs — v1
ToolsHTTP Tools

HTTP Tools

HTTP tools make custom HTTP requests to any endpoint. Unlike auto-generated API tools (derived from imported schemas), HTTP tools are created manually and give you full control over the request method, URL, headers, query parameters, and body.

In the UI

  1. Navigate to Tools and click Create Tool
  2. Select HTTP as the execution method
  3. Fill in a name and description
  4. Configure the request:
    • MethodGET, POST, PUT, PATCH, or DELETE
    • URL — the full endpoint URL (supports {{parameters.*}} expressions)
    • Headers — key-value pairs, including authentication headers
    • Query parameters — appended to the URL at execution time
    • Body — for POST/PUT/PATCH, a JSON or text body with template expressions
  5. Define input parameters using the schema builder — these become available as {{parameters.*}} in the URL, headers, and body
  6. Optionally set timeout and retry count
  7. Click Create

Template expressions

HTTP tools support {{parameters.*}} and {{env.*}} expressions in URLs, headers, query params, and body fields:

URL: https://api.example.com/users/{{parameters.userId}} Header: Authorization: Bearer {{parameters.token}} Body: { "name": "{{parameters.name}}", "email": "{{parameters.email}}" }

Custom code

For complex request logic, switch to the code editor and write JavaScript directly. The axios library is available as a global:

const response = await axios({ method: 'POST', url: `https://api.example.com/search`, headers: { 'Authorization': `Bearer ${parameters.apiKey}`, 'Content-Type': 'application/json', }, data: { query: parameters.query, filters: parameters.filters || {}, }, timeout: 10000, }); return { results: response.data.items, total: response.data.total, };

Via the API

curl -X POST /organizations/{orgId}/tools \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "fetch_weather", "description": "Fetch current weather for a city", "type": "http", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name" }, "units": { "type": "string", "enum": ["metric", "imperial"], "default": "metric" } }, "required": ["city"] }, "executionConfig": { "method": "GET", "url": "https://api.weather.example.com/v1/current", "headers": { "X-API-Key": "{{env.WEATHER_API_KEY}}" }, "queryParams": { "q": "{{parameters.city}}", "units": "{{parameters.units}}" } } }'

Configuration reference

FieldTypeDefaultDescription
methodstringHTTP method: GET, POST, PUT, PATCH, DELETE
urlstringFull URL, supports template expressions
headersobject{}Request headers, supports template expressions
queryParamsobject{}Query string parameters
bodyobject/stringRequest body (for POST/PUT/PATCH)
timeoutnumber30000Request timeout in milliseconds
retriesnumber0Number of retry attempts on failure

Authentication

HTTP tools can reference credentials via {{env.*}} expressions in headers:

API Key

{ "headers": { "X-API-Key": "{{env.API_KEY}}" } }

Bearer Token

{ "headers": { "Authorization": "Bearer {{env.ACCESS_TOKEN}}" } }

Basic Auth

{ "headers": { "Authorization": "Basic {{base64(env.USERNAME + ':' + env.PASSWORD)}}" } }

Error handling

Status CodeBehavior
2xxSuccess — response body is returned
4xxClient error — error message returned to the caller
5xxServer error — retried if retries > 0, then error
TimeoutRequest timed out — error returned
NetworkConnection failed — retried if configured

Custom code can implement additional error handling logic.