MCP Tools
get_document
Retrieve full document content by ID
Retrieve the complete content of a document, optionally including its chunks.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
documentId | string | REQUIRED | - | UUID of the document |
includeChunks | boolean | OPTIONAL | false | Include document chunks |
maxContentLength | number | OPTIONAL | 4000 | Maximum content characters to return (0 = full content) |
Example Request
{
"documentId": "550e8400-e29b-41d4-a716-446655440000",
"includeChunks": true
}Response
The MCP response contains both content (text for LLM consumption) and structuredContent (canonical JSON):
{
"content": [{ "type": "text", "text": "{...}" }],
"structuredContent": {
"document": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Q4 Planning Notes",
"sourceType": "note",
"sourceUrl": null,
"content": "Full document content...",
"metadata": { "tags": ["work", "planning", "q4"] },
"createdAt": "2024-10-15T14:30:00Z",
"updatedAt": "2024-10-15T14:30:00Z"
},
"chunks": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"index": 0,
"content": "First chunk content..."
},
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"index": 1,
"content": "Second chunk content..."
}
]
}
}Output Schema
This tool MUST return structuredContent alongside the text response. The structuredContent object MUST use canonical verbose keys regardless of the COMPACT_RESPONSES setting.
| Field | Type | Description |
|---|---|---|
document | object | The document |
document.id | string | Document UUID |
document.title | string | Document title |
document.sourceType | string | Source type (note, file, url) |
document.sourceUrl | string? | Source URL (null if not applicable) |
document.content | string | Document content (may be truncated) |
document.truncated | boolean | Whether content was truncated |
document.fullLength | integer | Full content length (when truncated) |
document.metadata | object? | Document metadata |
document.metadata.tags | string[] | Document tags (within metadata) |
document.createdAt | string | ISO creation timestamp |
document.updatedAt | string | ISO update timestamp |
chunks | array | Document chunks (when includeChunks=true) |
chunks[].id | string | Chunk UUID |
chunks[].index | integer | Chunk index |
chunks[].content | string | Chunk content |
Use Cases
Full Context Retrieval
After searching, get the complete document for context:
1. search returns chunk with documentId
2. get_document(documentId) returns full content
3. Use full content for comprehensive answersDocument Inspection
View all chunks for debugging:
{
"documentId": "...",
"includeChunks": true
}Error Responses
Document not found
{
"error": "Document not found",
"message": "No document with ID '550e8400-e29b-41d4-a716-446655440000'"
}