HTTP / REST tools — declare a remote endpoint as a uniform Toolnexus.Tool (SPEC §7).
Behavior mirrors the JS reference (js/src/http.ts):
{placeholder}s in the URL are substituted from args (URL-encoded, consumed)- args named in
:query— or all remaining args on GET — become querystring params remaining args become the body (json | form | raw) on non-GET/HEAD requests
${ENV_VAR}in header values expands from the environment at call time — expanded values are never logged- non-2xx ⇒
is_errorwith"HTTP <status>: <body>", otherwise the body text
Summary
Functions
Wrap an HTTP endpoint as a Tool.
Functions
@spec tool(keyword() | map()) :: Toolnexus.Tool.t()
Wrap an HTTP endpoint as a Tool.
Options (keyword list or map):
:name,:description,:method,:url(required):headers— map of header name → value; values may contain${ENV_VAR}:query— list of arg names sent as querystring instead of the body:body— body encoding for non-GET requests:"json"(default),"form","raw":input_schema— JSON schema map (default: empty object schema):timeout— request timeout in ms (default 30000):result_mode—"text"(default),"json", or"status+text":req_options— internal: extraReq.new/1options (e.g.plug:for tests)