outline_list_documents
Retrieve documents from Outline, with options to filter by collection and limit results for efficient document management.
Instructions
List documents from Outline, optionally filtered by collection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | No | Optional collection ID to filter documents | |
| limit | No | Maximum number of results to return (default: 25) |
Implementation Reference
- src/outline-client.ts:76-109 (handler)The implementation of the `listDocuments` method in `OutlineClient` which handles the API request to list Outline documents.
async listDocuments(collectionId?: string, limit: number = 25): Promise<Document[]> { const payload: any = { limit }; if (collectionId) { payload.collection = collectionId; } const endpoints = ['/api/documents.list', '/api/documents/list', '/api/documents', '/api/document/list']; for (const endpoint of endpoints) { try { console.error(`Trying endpoint: ${this.api.defaults.baseURL}${endpoint}`); const response = await this.api.post(endpoint, payload); // Debug: log the actual response structure console.error('Raw response data:', JSON.stringify(response.data, null, 2)); const data = response.data.data || response.data; if (Array.isArray(data) && data.length > 0) { console.error('Sample document structure:', JSON.stringify(data[0], null, 2)); } // Temporarily bypass schema validation and return raw data console.error('Returning raw document list:', JSON.stringify(data, null, 2)); return data as Document[]; } catch (error: any) { console.error(`Endpoint ${endpoint} failed:`, error.response?.status, error.response?.statusText); if (error.response?.status === 404 && endpoint !== endpoints[endpoints.length - 1]) { continue; } throw error; } } throw new Error('No valid endpoint found for listing documents'); } - src/index.ts:221-233 (handler)The MCP handler case for `outline_list_documents` in `src/index.ts`, which calls the client's `listDocuments` method.
case 'outline_list_documents': return { content: [ { type: 'text', text: JSON.stringify( await this.outlineClient.listDocuments(args.collectionId as string, args.limit as number), null, 2 ), }, ], }; - src/index.ts:46-63 (registration)Tool registration for `outline_list_documents` including its schema definition.
name: 'outline_list_documents', description: 'List documents from Outline, optionally filtered by collection', inputSchema: { type: 'object', properties: { collectionId: { type: 'string', description: 'Optional collection ID to filter documents', }, limit: { type: 'number', description: 'Maximum number of results to return (default: 25)', default: 25, }, }, required: [], }, },