get_door_document
Retrieve full content of DOOR Knowledge Base documents using document IDs obtained from search results to access detailed support articles and PDFs.
Instructions
Obtiene el contenido completo de un documento específico de la DOOR Knowledge Base. Usa el ID obtenido de search_door_knowledge.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ID del documento (obtenido de search_door_knowledge) |
Implementation Reference
- door-knowledge-mcp-server.js:89-102 (registration)Registration of the 'get_door_document' tool including name, description, and input schema in the ListToolsRequestHandler.{ name: 'get_door_document', description: 'Obtiene el contenido completo de un documento específico de la DOOR Knowledge Base. Usa el ID obtenido de search_door_knowledge.', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'ID del documento (obtenido de search_door_knowledge)', }, }, required: ['document_id'], }, },
- door-knowledge-mcp-server.js:199-226 (handler)Main handler function that loads the search index, finds the document by ID, reads the markdown content from file, and returns formatted response.async getDoorDocument(args) { const { document_id } = args; const index = await this.loadSearchIndex(); // Buscar documento en el índice const doc = index.documents.find(d => d.id === document_id); if (!doc) { throw new Error(`Documento no encontrado: ${document_id}`); } // Leer contenido completo const mdPath = path.join(this.knowledgeBasePath, doc.mdPath); try { const content = await fs.readFile(mdPath, 'utf-8'); return { content: [ { type: 'text', text: `# ${doc.title}\n\n**Categoría:** ${doc.category} > ${doc.subcategory}\n**Páginas:** ${doc.pages}\n**Archivo fuente:** ${doc.sourceFile}\n\n---\n\n${content}`, }, ], }; } catch (err) { throw new Error(`No se pudo leer el documento: ${err.message}`); } }
- door-knowledge-mcp-server.js:120-121 (handler)Dispatch case in CallToolRequestHandler that routes to the getDoorDocument method.case 'get_door_document': return await this.getDoorDocument(request.params.arguments);