Skip to main content
Glama
DynamicEndpoints

Document Extractor MCP Server

list_documents

Retrieve stored documentation from PocketBase with pagination controls to manage and access extracted content efficiently.

Instructions

List stored documents from PocketBase with pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of documents to return (default: 20, max: 100)
pageNoPage number for pagination (default: 1)

Implementation Reference

  • The "list_documents" tool is defined and implemented within the createServer function in src/index.js. It accepts pagination parameters (limit, page) and uses the getDocuments helper to fetch and display documents from PocketBase.
    const listDocumentsTool = server.tool(
      'list_documents',
      'List stored documents from PocketBase with pagination',
      {
        limit: z.number().min(1).max(100).optional().default(20).describe('Maximum number of documents to return (default: 20, max: 100)'),
        page: z.number().min(1).optional().default(1).describe('Page number for pagination (default: 1)')
      },    async ({ limit = 20, page = 1 }) => {
        try {
          // Only authenticate when tool is actually invoked
          await authenticateWhenNeeded();
          
          const result = await getDocuments(limit, page);
          
          if (result.items.length === 0) {
            return {
              content: [
                {
                  type: 'text',
                  text: '📚 No documents found in the database.'
                }
              ]
            };
          }
          
          const documentList = result.items.map(doc => 
            `**${doc.title}** (ID: ${doc.id})\n` +
            `Source: ${doc.metadata?.source || 'Unknown'}\n` +
            `Domain: ${doc.metadata?.domain || 'Unknown'}\n` +
            `Created: ${new Date(doc.created).toLocaleString()}\n` +
            `${doc.updated ? `Updated: ${new Date(doc.updated).toLocaleString()}\n` : ''}` +
            `${doc.metadata?.url ? `URL: ${doc.metadata.url}\n` : ''}`
          ).join('\n---\n');
          
          return {
            content: [
              {
                type: 'text',
                text: `📚 Found ${result.items.length} documents (Page ${page} of ${Math.ceil(result.totalItems / limit)}):\n` +
                      `Total: ${result.totalItems} documents\n\n${documentList}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `❌ Error: ${error.message}`
              }
            ],
            isError: true
          };
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Only mentions pagination behavior. Lacks disclosure on return format, whether results are ordered, authentication requirements, or handling of empty collections.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, seven words with no redundancy. 'Stored' is slightly redundant with 'from PocketBase' but overall efficient. Front-loaded with action verb.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for simple 2-parameter operation given good schema coverage, but gaps remain. No output schema exists yet description doesn't hint at return structure. Fails to clarify relationship with search_documents sibling, which is critical for tool selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed param descriptions (limit/page/range defaults). Description mentions 'pagination' which contextually maps to the parameters but adds no syntax or format details beyond what's in schema. Baseline 3 appropriate for high-coverage schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb+resource combination (List documents from PocketBase) and specifies pagination mechanism. However, it does not distinguish from sibling search_documents, which likely performs filtered queries while this returns unfiltered lists.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to prefer this over search_documents or get_document. Does not mention whether authentication is required (relevant given authenticate sibling) or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/DynamicEndpoints/documentation-mcp-using-pocketbase'

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