Skip to main content
This endpoint calls a deployed custom tool directly and returns whatever its handler returns. It is the same public surface the engine uses when an agent calls a custom tool mid-conversation, so you can exercise a handler from your own code or scripts with the exact contract the agent sees.
The tool must be deployed. <slug> is the tool’s slug from the Tools tab.

Request

  • Header: Authorization: Bearer $GRADIENT_API_KEY. The key needs the tools:invoke scope. See Authentication.
  • Header: content-type: application/json.
  • Query: v=<n> selects a specific deployed tool version. Omit it to run the latest deployed version.
  • Body: a JSON object with an input field. The value of input is delivered to your handler as its input argument.

Response

The response also carries execution metadata such as durationMs and httpStatus for the underlying handler run.
Pass an idempotency-key header to make a retry safe: the same key returns the first run’s result rather than invoking the handler again.

Errors

Handler shape, runtimes, deploy history, and how a tool attaches to a node are covered in Custom tools.