outline_get_document
Retrieve a specific document from Outline by its unique ID to access content for reading, editing, or reference.
Instructions
Get a specific document from Outline by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the document to retrieve |
Implementation Reference
- src/index.ts:193-205 (handler)The handler for 'outline_get_document' in the MCP server, which calls the OutlineClient.getDocument method.
case 'outline_get_document': return { content: [ { type: 'text', text: JSON.stringify( await this.outlineClient.getDocument(args.id as string), null, 2 ), }, ], }; - src/outline-client.ts:29-56 (handler)The actual implementation of the getDocument method that performs the API request to Outline.
async getDocument(id: string): Promise<Document> { // Try different possible endpoints const endpoints = ['/api/documents.info', '/api/documents/info', '/api/document/info']; for (const endpoint of endpoints) { try { console.error(`Trying get document endpoint: ${this.api.defaults.baseURL}${endpoint}`); const response = await this.api.post(endpoint, { id }); // Debug: log the actual response structure console.error('Get document raw response:', JSON.stringify(response.data, null, 2)); const data = response.data.data || response.data; // Temporarily bypass schema validation and return raw data console.error('Returning raw document data:', JSON.stringify(data, null, 2)); return data as Document; } catch (error: any) { console.error(`Get document endpoint ${endpoint} failed:`, error.response?.status, error.response?.statusText); if (error.response?.status === 404 && endpoint !== endpoints[endpoints.length - 1]) { console.error(`Endpoint ${endpoint} not found, trying next...`); continue; } throw error; } } throw new Error('No valid endpoint found for getting document'); }