# Test a tool

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

Runs the tool once against your endpoint with the arguments you give, and returns what came back. The request carries `X-Goblin-Test-Call: true` so your endpoint can tell it is not a real caller.

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

- `params` (object, optional): Argument values by name, as the model would supply them. Keys and values are strings.

## Response

- `success` (boolean): Whether your endpoint answered with a 2xx status.
- `status` (integer): Your endpoint’s HTTP status; `504` when it timed out.
- `data` (any): The response body, parsed as JSON when it is JSON.
- `error` (string): Set when the request failed.

## Errors

- `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).

## Notes

- The answer is `200` even when your endpoint failed; read `success`.

Request:

cURL:

```bash
curl -X POST "https://goblins-call-api.onrender.com/v1/tools/tool_5d2e8a41c07b/test" \
  -H "Authorization: Bearer $CRACKLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "order_id": "A-1042"
  }
}'
```

Node.js:

```js
const response = await fetch('https://goblins-call-api.onrender.com/v1/tools/tool_5d2e8a41c07b/test', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CRACKLE_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    params: {
      order_id: 'A-1042',
    },
  }),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

Python:

```python
import os
import requests

response = requests.post(
    "https://goblins-call-api.onrender.com/v1/tools/tool_5d2e8a41c07b/test",
    headers={"Authorization": f"Bearer {os.environ['CRACKLE_API_KEY']}"},
    json={
        "params": {
            "order_id": "A-1042",
        },
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()
```

Response · 200 OK:

```json
{
  "success": true,
  "status": 200,
  "latencyMs": 184,
  "data": { "status": "out for delivery", "eta": "today, 4 to 6 pm" },
  "headers": { "content-type": "application/json" }
}
```

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