read_logs
Read the lines komrad or the CLIs wrote about one agent, one of its hook runs' output, or the log of a language server over its task's checkout.
read-onlyidempotentMCP toolLog
Pass the returned cursor back to read only new lines.
Calling it#
curl -X POST http://127.0.0.1:8787/komrad.log.v1.LogService/ReadLogs \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "<agent_id>",
"service": "<service>"
}'komrad rpc read-logs \
--agent-id '<uuid>' \
--service '<ServiceLog>'{
"name": "read_logs",
"arguments": {
"agent_id": "<agent_id>",
"service": "<service>"
}
}Offered by the komrad MCP server to orchestrator agents.
Request#
ReadLogsRequest#
| Field | Type | Description |
|---|---|---|
agent_id | uuid* | The agent whose lines to read, by id. |
| one of* | The log to read. | |
service | ServiceLog | Which lines of the server log to read. |
hook_run_id | uuid | The hook run whose output to read, by the id |
language_server | string not empty | The language server whose log to read, by the name |
cursor | string | The |
limit | int32 between 0 and 1000 | The most lines to return. Zero returns up to 200. |
pattern | string at most 256 characters | A Go regular expression each line must match. Empty matches every line. Only the last 64 MB of the log is searched. |
Response#
ReadLogsResponse#
| Field | Type | Description |
|---|---|---|
lines | AgentLogLine[] | The lines, oldest first, as the log wrote them. |
cursor | string | The cursor to pass back to read only lines written after these. |
reset | bool | Whether the log started over since the cursor. The lines before the reset are gone. |
more | bool | Whether more lines remain past the cursor, which another call returns at once. |
Types#
AgentLogLine#
AgentLogLine is one line of an agent's log.
| Field | Type | Description |
|---|---|---|
text | string | The line, exactly as the log holds it. |
ServiceLog#
ServiceLog is which lines of the server log to read.
| Value | Description |
|---|---|
SERVICE_LOG_KOMRAD | Komrad's own lines. |
SERVICE_LOG_CLI | The records the agents' CLIs sent. |