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
- Navigate to Tools and click Create Tool
- Select HTTP as the execution method
- Fill in a name and description
- Configure the request:
- Method —
GET,POST,PUT,PATCH, orDELETE - 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
- Method —
- Define input parameters using the schema builder — these become available as
{{parameters.*}}in the URL, headers, and body - Optionally set timeout and retry count
- 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
| Field | Type | Default | Description |
|---|---|---|---|
method | string | — | HTTP method: GET, POST, PUT, PATCH, DELETE |
url | string | — | Full URL, supports template expressions |
headers | object | {} | Request headers, supports template expressions |
queryParams | object | {} | Query string parameters |
body | object/string | — | Request body (for POST/PUT/PATCH) |
timeout | number | 30000 | Request timeout in milliseconds |
retries | number | 0 | Number 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 Code | Behavior |
|---|---|
| 2xx | Success — response body is returned |
| 4xx | Client error — error message returned to the caller |
| 5xx | Server error — retried if retries > 0, then error |
| Timeout | Request timed out — error returned |
| Network | Connection failed — retried if configured |
Custom code can implement additional error handling logic.