outline_search_documents
Search for documents in Outline using text queries to find relevant content quickly and manage information retrieval.
Instructions
Search for documents in Outline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query to find documents | |
| limit | No | Maximum number of results to return (default: 25) |
Implementation Reference
- src/index.ts:207-219 (handler)Handler for 'outline_search_documents' inside the CallToolRequest handler.
case 'outline_search_documents': return { content: [ { type: 'text', text: JSON.stringify( await this.outlineClient.searchDocuments(args.query as string, args.limit as number), null, 2 ), }, ], }; - src/outline-client.ts:58-74 (handler)The actual implementation of searching documents within the OutlineClient class.
async searchDocuments(query: string, limit: number = 25): Promise<Document[]> { const endpoints = ['/api/documents.search', '/api/documents/search', '/api/document/search']; for (const endpoint of endpoints) { try { const response = await this.api.post(endpoint, { query, limit }); return response.data.data || response.data; } catch (error: any) { 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 searching documents'); } - src/index.ts:26-44 (schema)Registration and schema definition for 'outline_search_documents'.
{ name: 'outline_search_documents', description: 'Search for documents in Outline', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query to find documents', }, limit: { type: 'number', description: 'Maximum number of results to return (default: 25)', default: 25, }, }, required: ['query'], }, },