Skip to main content
Glama

list_documents

Retrieve a list of all documents indexed in the MCP Knowledge Base Server, enabling quick access to stored PDF, DOCX, TXT, and HTML files for processing or querying.

Instructions

列出知识库中的所有文档

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Registration of the 'list_documents' tool in the ListTools response, including name, description, and empty input schema.
    { name: 'list_documents', description: '列出知识库中的所有文档', inputSchema: { type: 'object', properties: {} } },
  • Handler implementation for the 'list_documents' tool. Retrieves all documents from the KnowledgeBase and formats a detailed list as text response.
    case 'list_documents': { const documents = await this.knowledgeBase.getAllDocuments(); let resultText = `知识库中共有 ${documents.length} 个文档:\n\n`; documents.forEach((doc, index) => { resultText += `${index + 1}. ${doc.title} (ID: ${doc.id})\n`; resultText += ` 类型: ${doc.fileType}\n`; resultText += ` 路径: ${doc.filePath}\n`; resultText += ` 创建时间: ${doc.createdAt.toLocaleString()}\n\n`; }); return { content: [ { type: 'text', text: resultText } ] }; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ikungsjl/mcp-knowledge-base'

If you have feedback or need assistance with the MCP directory API, please join our Discord server