Skip to main content
Every custom tool has a Parameters section. The parameters you declare there become the typed input the LLM is asked to fill in when it calls the tool — and they reach your runtime in different ways depending on the tool’s Action type.

Declaring a parameter

In the dashboard, each parameter has: Parameters are validated against the schema you declared before your tool runs. A type mismatch is rejected upstream and your handler is never invoked.

Code tools

For code tools, your function receives a single input object with one field per declared parameter, keyed by the Name you typed in. The entry point is fixed:

Type mapping (Code)

Notes

  • Optional parameters may be undefined (JS) / missing (Python). Use ?? or .get() to provide defaults.
  • Required parameters are guaranteed present — no need to null-check.
  • You cannot rename input or ctx in the signature.
  • There is no {{name}} placeholder syntax — params do not get string-substituted into your code body. They arrive as runtime values on input.

HTTP (API endpoint) tools

For api_endpoint tools, the parameters are serialized into the outbound HTTP request. How they are serialized depends on the chosen Method.

GET — parameters become URL query string

Each declared parameter is appended to endpoint_url as a query parameter. The key is the Name you typed; the value is stringified.
  • Primitives (string, number, integer, boolean) are converted with String(value).
  • object and array values are JSON-stringified into the query value.
  • undefined / null parameters are skipped entirely.
  • If your URL already contains a ?, additional params are appended with &.

POST / PUT / DELETE — parameters become JSON body

The full input object is sent as the request body, JSON-encoded. Content-Type: application/json is set automatically unless you defined a Content-Type header yourself.
If your endpoint expects a different shape (form-encoded, XML, nested under a single key, etc.), the recommended pattern is to wrap the call in a code tool — define your friendly parameter names on the tool, then translate them into the shape the upstream API wants inside handle().

Custom headers

Headers you configure on the tool are sent verbatim. They do not see your parameters — headers cannot reference input.<name>. For per-call header values (e.g. signing a request), use a code tool.

Type mapping (HTTP)

Choosing Code vs HTTP

  • Use HTTP when the upstream API accepts your parameter names directly as query string or JSON body.
  • Use Code when you need to transform parameters, sign requests, fan out to multiple endpoints, call other built-in tools, or apply business logic before responding.

See also