Tool file
http tools
Makes one HTTP request per call and returns the response body.
Makes one HTTP request per call and returns the response body. Every request carries Idempotency-Key (the same on every retry of the call), Dive-Run-Id, Dive-Call-Path and User-Agent: dive/<version>, plus traceparent when the run has a trace. When the run has a run token and the URL's origin is listed in [http].token_origins, the token goes as Authorization: Bearer <token>; it never goes anywhere else, and never into the run's entries or logs. Redirects aren't followed: a 3xx is a tool error naming its Location. A 2xx body is the result. Any other answer is a tool error named for its kind, taken from the body's error.code or else the status: refused (422), rejected input (400), the run token refused (401, 403), an internal error (500, never retried; a ref in the body is quoted), unavailable (429, 502, 503) or timed out (408, 504). Unavailable, timed out, a network error and no answer within timeout_secs are retried per retry. The message quotes the body's error.message, or the start of the body.
These fields go alongside the common fields, with kind: http.
Fields
The HTTP method.
Available options: GET, POST, PUT, PATCH, DELETE
The URL, as a template over {{input.*}}; each value spliced in is percent-encoded. ${VAR} resolves the same way as an exec tool's env, so a base URL can be ${APP_URL} and a secret can sit in the URL.
Query parameters, each value a template over {{input.*}}. A value that is a single template whose input is missing is left out.
Extra headers. Values expand ${VAR} like exec env, so a static credential can come from a secret, but can't use {{input.*}}. A tool can't set Authorization on a call that also carries the run token; send its credential in another header.
POST, PUT and PATCH send the whole input as JSON. A body template, a JSON tree whose leaf strings are templates over {{input.*}} like a reshape tool's shape, sends that object instead. GET and DELETE send no body.
Seconds before one attempt times out.
Retries for a network error, no answer within timeout_secs, or an answer that says the app is unavailable or timed out (429, 502, 503, 408, 504, or error.code unavailable or timeout). An internal error (500) is never retried. Without it, a call is tried once.
Total attempts, the first included. Retries wait 1, 2, then 4 seconds, or what Retry-After says.
json parses the body as JSON, with an empty body as {}; text returns it as {text}.
Available options: json, text
The largest body read; a larger one is a tool error.
version: 5
name: create_issue
description: Creates an issue in the tenant's tracker and returns its id and URL.
kind: http
method: POST
url: ${APP_URL}/dive/tools/create_issue
retry:
attempts: 3
input_schema:
type: object
required:
- title
properties:
title:
type: string
description: One-line summary
output_schema:
type: object
properties:
id:
type: string
url:
type: string