# list\_log\_sources

List the hook runs and language servers whose logs can be read for one agent.

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

## Calling it

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

```bash
komrad rpc list-log-sources \
  --agent-id '<uuid>'
```

```json
{
  "name": "list_log_sources",
  "arguments": {
    "agent_id": "<agent_id>"
  }
}
```

Offered by the komrad MCP server to orchestrator agents.

## Request

### ListLogSourcesRequest

| Field | Type | Description |
| --- | --- | --- |
| [`agent_id`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-ListLogSourcesRequest-agent_id) | uuid\* | The agent whose logs to list, by id. |

## Response

### ListLogSourcesResponse

| Field | Type | Description |
| --- | --- | --- |
| [`agent`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-ListLogSourcesResponse-agent) | [LogAgent](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LogAgent) | The agent. |
| [`hook_runs`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-ListLogSourcesResponse-hook_runs) | [HookRun\[\]](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun) | The agent's hook runs that wrote a log, newest first, those of its task's moments included. |
| [`language_servers`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-ListLogSourcesResponse-language_servers) | [LanguageServerLog\[\]](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LanguageServerLog) | The logs of the language servers over the checkout of the agent's task, by name. Empty when the task has no checkout. |

## Types

### LogAgent

LogAgent is the agent whose logs a read holds.

| Field | Type | Description |
| --- | --- | --- |
| [`id`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LogAgent-id) | uuid\* | The agent's id. |
| [`name`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LogAgent-name) | string | The agent's name. |
| [`role`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LogAgent-role) | [AgentRole](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-agent-v1-AgentRole) | The agent's role. |
| [`created_at`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LogAgent-created_at) | timestamp | When the agent was created. |
| [`archived_at`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LogAgent-archived_at) | timestamp | When the agent was archived. Unset while the agent is live. |

### HookRun

HookRun is one run of a hook's script for an agent.

| Field | Type | Description |
| --- | --- | --- |
| [`id`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-id) | uuid\* | The hook run's id, to pass as `hook_run_id` to [`read_logs`](https://komrad.dev/latest/api/log/read-logs.md). |
| [`agent_id`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-agent_id) | uuid\* | The agent the hook ran for, by id. |
| [`number`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-number) | int32 | The hook run's number among the agent's hook runs. |
| [`trigger`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-trigger) | [Moment](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment) | The moment the script ran at. |
| [`script`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-script) | string | The hook's script, by file name in the hooks directory. |
| [`started_at`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-started_at) | timestamp | When the hook run started. |
| [`finished_at`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-finished_at) | timestamp | When the hook run finished. Unset while it runs. |
| [`failed`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-HookRun-failed) | bool | Whether the hook run failed. |

### LanguageServerLog

LanguageServerLog is the log of one language server over a task's checkout.

| Field | Type | Description |
| --- | --- | --- |
| [`name`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LanguageServerLog-name) | string | The language server's name, to pass as `language_server` to [`read_logs`](https://komrad.dev/latest/api/log/read-logs.md). |
| [`written_at`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-log-v1-LanguageServerLog-written_at) | timestamp | When the language server last wrote to its log. |

### AgentRole

AgentRole is what an agent was launched to do.

| Value | Description |
| --- | --- |
| [`reviewer`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-agent-v1-AgentRole-reviewer) | An agent on a task that reads the writer's change and gives a review. |
| [`orchestrator`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-agent-v1-AgentRole-orchestrator) | The one agent per workflow that hands work out across its tasks. |
| [`writer`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-agent-v1-AgentRole-writer) | The one agent on a task that changes its checkout. |

### Moment

Moment is a point in the life of an agent or task at which komrad runs a script.

| Value | Description |
| --- | --- |
| [`agent.provision`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.provision) | runs the provisioner before komrad creates an agent's directory |
| [`agent.resume`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.resume) | reruns the provisioner before komrad resumes an agent |
| [`agent.deprovision`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.deprovision) | runs the deprovisioner as komrad releases an agent's directory |
| [`agent.pre-launch`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.pre-launch) | runs in the agent's directory before its pane opens, and a failure abandons the create |
| [`agent.post-launch`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.post-launch) | runs once the agent's pane opens |
| [`agent.pre-resume`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.pre-resume) | runs in the agent's directory before a dormant agent's pane opens, and a failure refuses the resume |
| [`agent.post-resume`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.post-resume) | runs once a dormant agent is back in a pane |
| [`agent.pre-archive`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.pre-archive) | runs while the agent is still running, and a failure refuses the archive |
| [`agent.post-archive`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.post-archive) | runs in the agent's directory after komrad closes its pane and archives it |
| [`agent.pre-restore`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.pre-restore) | runs before an archived agent's row comes back, and a failure refuses the restore |
| [`agent.post-restore`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.post-restore) | runs when an archived agent's row comes back |
| [`agent.pre-delete`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.pre-delete) | runs in the agent's directory as komrad deletes it, before komrad releases the worktree |
| [`agent.post-delete`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-agent.post-delete) | runs once the agent and its worktree are gone |
| [`task.pre-open`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-task.pre-open) | runs before a task's first live agent opens its pane, and a failure abandons the create or restore |
| [`task.post-archive`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-task.post-archive) | runs after komrad archives a task's last live agent, and the task with it |
| [`task.pre-delete`](https://komrad.dev/latest/api/log/list-log-sources.md#komrad-event-v1-Moment-task.pre-delete) | runs as komrad deletes a task, before it releases the worktree, and a failure keeps the task |
