# get\_document\_type

Read one document type and its context by name.

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

## Calling it

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

```bash
komrad rpc get-document-type \
  --name '<string>'
```

```json
{
  "name": "get_document_type",
  "arguments": {
    "name": "<name>"
  }
}
```

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

## Request

### GetDocumentTypeRequest

| Field | Type | Description |
| --- | --- | --- |
| [`name`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-GetDocumentTypeRequest-name) | string\* | The document type to read, by name. |
| [`version`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-GetDocumentTypeRequest-version) | int32 more than 0 | The version to read. Unset reads the newest. |

## Response

### GetDocumentTypeResponse

| Field | Type | Description |
| --- | --- | --- |
| [`document_type`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-GetDocumentTypeResponse-document_type) | [DocumentType](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-DocumentType) | The document type, with its context. |

## Types

### DocumentType

DocumentType is one kind of document, with the context an agent reads before writing one.

| Field | Type | Description |
| --- | --- | --- |
| [`id`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-DocumentType-id) | uuid\* | The document type's id. |
| [`name`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-DocumentType-name) | string | The document type's name, which each document of the type carries as `type`. |
| [`context`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-DocumentType-context) | string | The markdown an agent reads before writing a document of this type. |
| [`version`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-DocumentType-version) | int32 | How many times the document type has been written. |
| [`updated_at`](https://komrad.dev/latest/api/agent/get-document-type.md#komrad-agent-v1-DocumentType-updated_at) | timestamp | When the document type was last written. |
