# run\_doctor

Check whether the machine the server runs on can run agents.

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

The checks cover tmux, the config, the CLIs, hooks, worktree directories and the database.

## Calling it

```bash
curl -X POST http://127.0.0.1:8787/komrad.doctor.v1.DoctorService/RunDoctor \
  -H 'Content-Type: application/json' \
  -d '{}'
```

```bash
komrad rpc run-doctor
```

```json
{
  "name": "run_doctor",
  "arguments": {}
}
```

Offered by the komrad MCP server to orchestrator agents.

## Request

### Empty

No fields.

## Response

### RunDoctorResponse

| Field | Type | Description |
| --- | --- | --- |
| [`findings`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-RunDoctorResponse-findings) | [Finding\[\]](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding) | Every check, in the order it ran. |
| [`summary`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-RunDoctorResponse-summary) | [Summary](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary) | The findings counted by status. |

## Types

### Finding

Finding is the result of one doctor check.

| Field | Type | Description |
| --- | --- | --- |
| [`name`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-name) | string | The check's name, such as `database` or `tmux version`. |
| [`description`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-description) | string | What the check is for, in one sentence. |
| [`status`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-status) | [Status](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Status) | How the check came out. |
| [`detail`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-detail) | string | What the check found, such as a version or a path. Empty when there is nothing to report. |
| [`code`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-code) | string | A stable code for the problem, such as `db_unreachable`. Empty when nothing went wrong. |
| [`error`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-error) | string | The problem, as the check worded it. Empty when nothing went wrong. |
| [`fix`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Finding-fix) | string | What to do about the problem. Empty when there is nothing to do. |

### Summary

Summary counts the findings of a doctor run by status.

| Field | Type | Description |
| --- | --- | --- |
| [`ok`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary-ok) | int32 | How many checks passed. |
| [`warn`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary-warn) | int32 | How many checks passed with a warning. |
| [`fail`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary-fail) | int32 | How many checks failed. |
| [`skip`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary-skip) | int32 | How many checks were skipped because a check they need did not pass. |
| [`total`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary-total) | int32 | How many checks there are in all. |
| [`healthy`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Summary-healthy) | bool | Whether no check failed. |

### Status

Status is how a doctor check came out.

| Value | Description |
| --- | --- |
| [`ok`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Status-ok) | The check passed. |
| [`warn`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Status-warn) | The check passed with a warning. |
| [`fail`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Status-fail) | The check failed. |
| [`skip`](https://komrad.dev/latest/api/doctor/run-doctor.md#komrad-doctor-v1-Status-skip) | The check was skipped because a check it needs did not pass. |
