# get\_log\_lines

Read every log line written under one trace id, in order.

read-only · idempotent · MCP tool · [Log](https://komrad.dev/latest/api/log.md)

A failed call returns its trace id.

## Calling it

```bash
curl -X POST http://127.0.0.1:8787/komrad.log.v1.LogService/GetLogLines \
  -H 'Content-Type: application/json' \
  -d '{
  "trace_id": "<trace_id>"
}'
```

```bash
komrad rpc get-log-lines \
  --trace-id '<string>'
```

```json
{
  "name": "get_log_lines",
  "arguments": {
    "trace_id": "<trace_id>"
  }
}
```

Offered by the komrad MCP server to orchestrator agents.

## Request

### GetLogLinesRequest

| Field | Type | Description |
| --- | --- | --- |
| [`trace_id`](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-GetLogLinesRequest-trace_id) | string\* at most 128 characters | The trace id to read, from a failed call or from [`list_recent_traces`](https://komrad.dev/latest/api/log/list-recent-traces.md). |

## Response

### GetLogLinesResponse

| Field | Type | Description |
| --- | --- | --- |
| [`lines`](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-GetLogLinesResponse-lines) | [LogLine\[\]](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-LogLine) | Every line written under the trace id, in the order they were written. |

## Types

### LogLine

LogLine is one line of the server's log.

| Field | Type | Description |
| --- | --- | --- |
| [`time`](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-LogLine-time) | timestamp | When the line was written. |
| [`level`](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-LogLine-level) | string | The line's severity, such as `INFO` or `ERROR`. |
| [`message`](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-LogLine-message) | string | The line's message. |
| [`fields`](https://komrad.dev/latest/api/log/get-log-lines.md#komrad-log-v1-LogLine-fields) | json | The line's other fields, under the keys the log gives them. |
