# lg_agents_test_run: Test-run a draft

Test-run an agent's draft once, as a dry run (nothing is sent or changed).

- **Changes data:** yes
- **Credential scope:** `agents:write` (an API key's scopes, or what you allowed when connecting with OAuth)
- **Assistant level:** an assistant at Read and draft or above

## Inputs

| Field | Type | Required | Notes |
|---|---|---|---|
| `id` | string | yes |  |
| `body` | object (input) | no |  |
| `body.input` | object | no |  |

## Example MCP call

A `tools/call` request to `https://manage.restolayer.com/mcp`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lg_agents_test_run",
    "arguments": {
      "id": "agt_01HZXEXAMPLE",
      "body": {
        "input": {}
      }
    }
  }
}
```

## Example REST call

The same thing over REST (`POST /v1/agents/:id/test-run`):

```bash
curl -s -X POST "https://manage.restolayer.com/v1/agents/agt_01HZXEXAMPLE/test-run" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

All tools: [MCP tools](https://www.restolayer.com/docs/mcp/tools). Connecting: [connect your assistant](https://www.restolayer.com/docs/connect).
