# log

Write one line to komrad's log, under the caller unless `id` names another agent.

writes · not idempotent · MCP tool · [Agent](https://komrad.dev/latest/api/agent.md)

A hook uses it to leave a trace.

## Calling it

```bash
curl -X POST http://127.0.0.1:8787/komrad.agent.v1.AgentService/Log \
  -H 'Content-Type: application/json' \
  -d '{
  "message": "<message>"
}'
```

```bash
komrad rpc log \
  --message '<string>'
```

```json
{
  "name": "log",
  "arguments": {
    "message": "<message>"
  }
}
```

Offered by the komrad MCP server to writer, reviewer, orchestrator agents.

## Request

### LogRequest

| Field | Type | Description |
| --- | --- | --- |
| [`id`](https://komrad.dev/latest/api/agent/log.md#komrad-agent-v1-LogRequest-id) | uuid | The agent the line is about, by id. Unset for the caller. |
| [`message`](https://komrad.dev/latest/api/agent/log.md#komrad-agent-v1-LogRequest-message) | string\* at most 2048 characters a log message must carry no control characters | The line to write. |
| [`script`](https://komrad.dev/latest/api/agent/log.md#komrad-agent-v1-LogRequest-script) | string at most 255 characters must be a file name without a slash, a leading dot or control characters | The hook whose run the line belongs to. A running hook finds its name in `KOMRAD_SCRIPT`. |

## Response

### Empty

No fields.
