Skip to main content
Glama
DynamicEndpoints

Document Extractor MCP Server

extract_document

Extract content from Microsoft Learn or GitHub URLs and store it in PocketBase for organized retrieval and full-text search.

Instructions

Extract document content from Microsoft Learn or GitHub URL and store in PocketBase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesMicrosoft Learn or GitHub URL to extract content from

Implementation Reference

  • The 'extract_document' tool handler registers the tool, defines its input schema (zod), and executes the logic to extract and store content from Microsoft Learn or GitHub URLs.
    server.tool(
      'extract_document',
      'Extract document content from Microsoft Learn or GitHub URL and store in PocketBase',
      {
        url: z.string().url('Invalid URL format').describe('Microsoft Learn or GitHub URL to extract content from')
      },
      async ({ url }) => {
        try {
          await authenticateWhenNeeded();
          
          let docData;
          if (url.includes('learn.microsoft.com')) {
            docData = await extractFromMicrosoftLearn(url);
          } else if (url.includes('github.com') || url.includes('raw.githubusercontent.com')) {
            docData = await extractFromGitHub(url);
          } else {
            throw new Error('Unsupported URL. Only Microsoft Learn and GitHub URLs are supported.');
          }
          
          const record = await storeDocument(docData);
          
          return {
            content: [{
              type: 'text',
              text: `${record.isUpdate ? '🔄 Document updated' : '✅ Document extracted and stored'} successfully!\n\n` +
                    `**Title:** ${record.title}\n` +
                    `**ID:** ${record.id}\n` +
                    `**Source:** ${docData.metadata.source}\n` +
                    `**URL:** ${docData.metadata.url}\n` +
                    `**Word Count:** ${docData.metadata.wordCount}\n` +
                    `**Content Preview:** ${docData.content.substring(0, 200)}...`
            }]
          };
        } catch (error) {
          return toolErrorHandler(error);
        }
      }
Behavior2/5

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

No annotations provided, so description carries full burden. While 'store' indicates a write operation, description lacks critical behavioral details: idempotency, overwrite behavior on duplicates, validation rules for URLs, error handling, or authentication requirements.

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

Conciseness5/5

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

Single efficient sentence with zero waste. Front-loaded with action verbs ('Extract... and store') and immediately scopes inputs (specific URL types) and outputs (PocketBase destination).

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

Completeness4/5

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

Adequate for a single-parameter ingestion tool. Description covers source system (external URL) and target system (PocketBase), which is sufficient given no output schema exists and schema fully documents the input parameter.

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%, establishing baseline 3. The parameter description in the schema already specifies 'Microsoft Learn or GitHub URL', so the main description adds minimal semantic value beyond repetition. No additional syntax details or examples provided.

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

Purpose5/5

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

Clear specific verbs ('Extract' and 'store') with defined resource (document content from Microsoft Learn/GitHub) and destination (PocketBase). Effectively distinguishes from siblings like get_document (internal retrieval) and search_documents (querying) by specifying external URL sources.

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

Usage Guidelines3/5

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

Provides implied usage scope by restricting to 'Microsoft Learn or GitHub URL', indicating when to use this over internal document tools. However, lacks explicit guidance on prerequisites (e.g., authentication) or when-not-to-use compared to siblings like ensure_collection.

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