Skip to main content
Glama
DynamicEndpoints

Document Extractor MCP Server

collection_info

Retrieve statistics and details about extracted document collections to monitor content volume, track metadata, and manage organized documentation storage.

Instructions

Get detailed information about the documents collection including statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration and handler logic for the 'collection_info' tool in server.js.
    server.tool(
      'collection_info',
      'Get detailed information about the documents collection including statistics',
      {},
      async () => {
        try {
          await authenticateWhenNeeded();
          
          const info = await getCollectionInfo();
          
          const schemaInfo = info.collection.schema?.map(field => 
            `- **${field.name}** (${field.type})${field.required ? ' *required*' : ''}`
          ).join('\n') || 'No schema information available';
          
          return {
            content: [{
              type: 'text',
              text: `📊 **Collection Information: ${info.collection.name}**\n\n` +
                    `**Basic Details:**\n` +
                    `- ID: ${info.collection.id}\n` +
                    `- Name: ${info.collection.name}\n` +
                    `- Type: ${info.collection.type}\n` +
                    `- Created: ${new Date(info.collection.created).toLocaleString()}\n` +
                    `- Updated: ${new Date(info.collection.updated).toLocaleString()}\n\n` +
                    `**Statistics:**\n` +
                    `- Total Records: ${info.totalRecords}\n` +
                    `- Total Pages: ${info.totalPages}\n` +
                    `- Records Per Page: ${info.recordsPerPage}\n\n` +
                    `**Schema Fields:**\n${schemaInfo}\n\n` +
                    `**Indexes:**\n${info.collection.indexes?.length ? 
                      info.collection.indexes.map(idx => `- ${idx}`).join('\n') : 
                      'No custom indexes defined'}`
            }]
          };
        } catch (error) {
          return toolErrorHandler(error);
        }
      }
    );
  • Helper function to fetch collection metadata and statistics from PocketBase.
    async function getCollectionInfo() {
      await authenticateWhenNeeded();
      try {
        const collection = await pb.collections.getOne(DOCUMENTS_COLLECTION);
        const stats = await pb.collection(DOCUMENTS_COLLECTION).getList(1, 1);
        return {
          collection,
          totalRecords: stats.totalItems,
          recordsPerPage: stats.perPage,
          totalPages: stats.totalPages
        };
      } catch (error) {
        debugLog('❌ Error getting collection info', { error: error.message });
        throw new Error(`Failed to get collection info: ${error.message}`);
      }
    }
Behavior3/5

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

No annotations provided, so description carries full burden. Mentions 'statistics' implying read-only metadata retrieval, but lacks disclosure on performance implications of 'detailed' queries, specific return structure, or confirmation of read-only status given no output schema exists.

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 efficient sentence with strong verb front-loading ('Get'). No redundant text, though 'detailed information' is vague and could be more specific about what statistics are returned.

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 a zero-parameter tool but vague on specific return values given no output schema exists. Mentions 'statistics' generally but doesn't clarify if this returns counts, sizes, timestamps, or schema info. Relationship to ensure_collection sibling remains unclear.

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

Parameters4/5

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

Input schema contains zero parameters, triggering baseline score of 4 per rubric. No parameter documentation needed.

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?

The description identifies a specific verb ('Get'), resource ('documents collection'), and scope ('detailed information', 'statistics'). It distinguishes from document-level siblings like get_document and delete_document by targeting collection-level metadata rather than individual documents.

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 provided on when to use this versus ensure_collection (likely for initialization/setup) or when to prefer this over list_documents for collection summaries. No prerequisites or exclusions stated.

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