---
title: "Execute a tool by name"
method: POST
path: "/public/tools/{name}/run"
tags: ["Tools"]
---

# Execute a tool by name

`POST /public/tools/{name}/run`

## Request

- Base URL: `https://api.johnsessentials.com/api/v1`
- URL: `https://api.johnsessentials.com/api/v1/public/tools/{name}/run`
- Auth: HTTP bearer

Runs the named tool with the provided JSON params. Schema for
params varies per tool — fetch it from `/public/tools/{name}`.
File inputs may be referenced by ID (uploaded via
`/public/files/upload`) or sent inline as multipart/form-data.

## Path parameters

- `name` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object

## Response `200`

Tool ran successfully.

- object
  - `data` object: Handler payload on success; null on error.
    - `duration_ms` integer
    - `file_id` string
    - `size` integer
    - `url` string, uri
  - `error` ErrorBody: Additional fields per code (validation errors, retry_after, hints) appear at this level. additionalProperties: true is intentional.
    - `code` 'auth_missing_header' | 'auth_malformed_header' | 'auth_invalid_key' | 'auth_expired_key' | 'auth_inactive_key' | 'auth_scope_missing' | 'quota_calls_exceeded' | 'quota_cost_exceeded' | 'quota_storage_exceeded' | 'quota_agent_runs_exceeded' | 'credit_exhausted' | 'tool_not_found' | 'tool_input_invalid' | 'tool_file_too_large' | 'tool_file_not_found' | 'tool_unsupported' | 'tool_timeout' | 'tool_internal' | 'idempotency_key_in_use' | 'agent_max_iterations' | 'agent_unauthorized_tool' | 'agent_invalid_plan' | 'workflow_not_found' | 'workflow_invalid' | 'bad_request' | 'forbidden' | 'not_found' | 'conflict' | 'internal_error' | 'service_unavailable', required: Stable canonical code from the taxonomy. Branch on this, not on `message`. Full list at /api/errors.
    - `doc_url` string, uri, required
    - `message` string, required
    - `request_id` string, uuid
  - `meta` EnvelopeMeta, required
    - `rate_limit` object
      - `limit` integer
      - `remaining` integer
      - `reset` integer: Unix seconds
    - `timestamp` string, date-time, required
    - `version` string, required
  - `request_id` string, uuid, required
  - `success` boolean, required

## Other responses

- `400`: Request validation failed.
- `402`: Monthly USD cost cap reached for this key (quota_cost_exceeded). Phase 3 / M3.
- `404`: Resource not found.
- `408`: Tool execution timed out (tool_timeout).
- `413`: Uploaded file exceeds the per-tier size limit.
- `429`: Sliding 1-hour rate limit exceeded.

---

[API](https://skmtc.dev/johnsessentials/apis/john-s-essentials-api.md) · [All operations](https://skmtc.dev/johnsessentials/apis/john-s-essentials-api/llms.txt) · [OpenAPI document](https://skmtc.dev/johnsessentials/apis/john-s-essentials-api/revisions/56586ff78e6d?raw)
