# Record an agent's tool call in the change feed (`tool_call` events): what an MCP server reports after each call, its own tools included (`served_by`). Any token may call it.

`POST /datanotes/tool-calls/record/` (operation `record_tool_call`)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Datanotes-Actor` | header | `string` | no | JSON: on whose behalf the write is made, recorded in the journal (`harness`, `model`, `session`). |

## Request body

`application/json`, required

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `tool` | `string` | yes |  |  |
| `args` | `object` | no |  |  |
| `ok` | `boolean` | no |  |  |
| `duration_ms` | `number` | no |  |  |
| `value` | `any` | no |  |  |
| `served_by` | `string` | no |  |  |
| `session` | `string` | no |  |  |
| `result_chars` | `number` | no |  |  |
| `result_tokens` | `number` | no |  |  |

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Done. | `object` (application/json) |
| 400 | Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type. | `Error` (application/json) |
| 401 | Missing or wrong bearer token. | `Error` (application/json) |
| 500 | Unexpected error. | `Error` (application/json) |

The schemas named here are in [openapi.json](https://datanotes.dev/openapi.json) (`components.schemas`).
