# Update a tool

`PUT` `https://goblins-call-api.onrender.com/v1/tools/:id`

Changes the fields you send and leaves the rest as they are. The agent a tool belongs to cannot be changed.

Needs a [workspace API key](https://www.cracklehq.com/docs/authentication).

## Path parameters

- `id` (string, required): The tool’s ID, such as `tool_5d2e8a41c07b`.

## Body

- `name` (string, optional, 1–128 chars): An identifier the model uses to ask for the tool, such as `check_order_status`. It is saved in lower case with anything but letters, digits and `_` turned into `_`. Instructions mention it as `@check_order_status`.
- `description` (string, optional, up to 5,000 chars): What the tool does and when to use it. The model reads this to decide.
- `kind` (enum, optional, during_call · before_call; default during_call): `during_call` tools are run by the model in the middle of a conversation. `before_call` tools run once as the call starts, and their response is added to the agent’s instructions.
- `method` (enum, optional, GET · POST; default GET): The HTTP method of the request to your endpoint.
- `url` (string, optional): Your endpoint. Must be a public `http(s)` address; redirects are not followed. May contain `{{placeholders}}`.
- `params` (object[], optional): The arguments the model supplies, each `{ "key": "order_id", "value": "A-1042" }`. `value` is an example shown to the model, and what is sent when the model leaves the argument out. Sent as the query string of a `GET`, or as the JSON body of a `POST` that has no `body` of its own.
- `headers` (object[], optional): Extra request headers, each `{ "key", "value" }`. Values may contain `{{placeholders}}`.
- `body` (string, optional): A body template for a `POST`, with `{{placeholders}}`. Sent as JSON unless a `Content-Type` header says otherwise.
- `auth` (enum, optional, none · bearer · api_key · basic; default none): How the request authenticates to your endpoint.
- `authToken` (string, optional): The bearer token, API key or basic-auth password. Stored encrypted.
- `authKeyHeader` (string, optional, default X-API-Key): The header an `api_key` credential is sent in.
- `authUsername` (string, optional): The username for `basic` auth.
- `timeoutMs` (integer, optional, 500–60,000; default 10,000): How long to wait for your endpoint. A request is cut off at 30 seconds whatever is set here.
- `outputs` (object[], optional): The fields your endpoint answers with, each `{ "name", "description" }`, for your own reference in the studio.
- `sampleOutput` (string, optional): An example response. The model is shown it so it knows what to expect back.

## Errors

- `400`: The body failed validation. `details` lists each field and what is wrong with it.
- `400` `URL_NOT_ALLOWED`: The URL is not a public `http(s)` address.
- `404`: No tool in your workspace has that ID.

Every request can also answer `401`, `429` and `500`: see [Errors](https://www.cracklehq.com/docs/errors).

Request:

cURL:

```bash
curl -X PUT "https://goblins-call-api.onrender.com/v1/tools/tool_5d2e8a41c07b" \
  -H "Authorization: Bearer $CRACKLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "timeoutMs": 8000,
  "description": "Looks up an order by its number and says when it will arrive."
}'
```

Node.js:

```js
const response = await fetch('https://goblins-call-api.onrender.com/v1/tools/tool_5d2e8a41c07b', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CRACKLE_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    timeoutMs: 8000,
    description: 'Looks up an order by its number and says when it will arrive.',
  }),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

Python:

```python
import os
import requests

response = requests.put(
    "https://goblins-call-api.onrender.com/v1/tools/tool_5d2e8a41c07b",
    headers={"Authorization": f"Bearer {os.environ['CRACKLE_API_KEY']}"},
    json={
        "timeoutMs": 8000,
        "description": "Looks up an order by its number and says when it will arrive.",
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()
```

Response · 200 OK:

```json
{
  "tool": {
    "id": "tool_5d2e8a41c07b",
    "userId": "usr_8c1d2e3f4a5b",
    "agentId": "ua_3f9a1c2b",
    "name": "check_order_status",
    "description": "Looks up an order by its number, which the caller reads out. Use it when the caller asks where their order is.",
    "kind": "during_call",
    "method": "GET",
    "url": "https://your-app.com/api/orders/{{order_id}}",
    "timeoutMs": 5000,
    "params": [{ "key": "order_id", "value": "A-1042" }],
    "headers": [],
    "auth": "bearer",
    "authToken": "…",
    "outputs": [{ "name": "status" }, { "name": "eta" }],
    "createdAt": "2026-10-11T08:20:03.000Z",
    "updatedAt": "2026-10-11T08:20:03.000Z"
  }
}
```

Source: https://www.cracklehq.com/docs/reference/tools/update
