Skip to main content
Glama

Get PDFDancer documentation

get-docs

Retrieve complete documentation content for specific routes, including code examples, detailed explanations, and API references, after identifying relevant documentation through search.

Instructions

Retrieve the full documentation content for a specific route. After finding relevant documentation with search-docs, use this tool to get the complete markdown content including code examples, detailed explanations, and API references.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routeYes

Implementation Reference

  • Handler function for the 'get-docs' tool. Takes a route parameter, calls the /content API endpoint, and returns markdown-formatted content blocks with the JSON data and full documentation text, plus structured content.
    async ({route}) => {
        const data = await callApi<ContentResponse>('/content', {
            searchParams: {
                route
            }
        });
    
        return {
            content: [
                {
                    type: 'text' as const,
                    text: formatJsonBlock(`Content for ${route}`, data)
                },
                {
                    type: 'text' as const,
                    text: data.content
                }
            ],
            structuredContent: data
        };
    }
  • Zod input schema for 'get-docs' tool, validating the 'route' parameter as a string starting with '/'.
    inputSchema: {
        route: z.string().regex(/^\/.*/, 'route must start with /')
    }
  • src/index.ts:266-296 (registration)
    Registration of the 'get-docs' tool with McpServer, including title, description, input schema, and inline handler function.
    server.registerTool(
        'get-docs',
        {
            title: 'Get PDFDancer documentation',
            description: 'Retrieve the full documentation content for a specific route. After finding relevant documentation with search-docs, use this tool to get the complete markdown content including code examples, detailed explanations, and API references.',
            inputSchema: {
                route: z.string().regex(/^\/.*/, 'route must start with /')
            }
        },
        async ({route}) => {
            const data = await callApi<ContentResponse>('/content', {
                searchParams: {
                    route
                }
            });
    
            return {
                content: [
                    {
                        type: 'text' as const,
                        text: formatJsonBlock(`Content for ${route}`, data)
                    },
                    {
                        type: 'text' as const,
                        text: data.content
                    }
                ],
                structuredContent: data
            };
        }
    );
  • Helper function 'callApi' used by 'get-docs' handler to make HTTP GET requests to the documentation API endpoints, construct URLs, handle parameters, fetch, parse JSON, and throw errors on failure.
    async function callApi<T>(path: string, options: ApiRequestOptions = {}): Promise<T> {
        const url = new URL(path, apiBase);
        if (options.searchParams) {
            Object.entries(options.searchParams).forEach(([key, value]) => {
                if (value !== undefined && value !== null && value !== '') {
                    url.searchParams.set(key, String(value));
                }
            });
        }
    
        const method = options.method ?? 'GET';
        const init: RequestInit = {
            method,
            headers: {
                Accept: 'application/json',
                ...(options.body ? {'Content-Type': 'application/json'} : {})
            }
        };
    
        if (options.body && method === 'POST') {
            init.body = JSON.stringify(options.body);
        }
    
        const response = await fetch(url, init);
        const text = await response.text();
    
        if (!response.ok) {
            throw new Error(
                `Request to ${url.toString()} failed with status ${response.status}: ${
                    text || response.statusText
                }`
            );
        }
    
        if (!text) {
            return undefined as T;
        }
    
        try {
            return JSON.parse(text) as T;
        } catch (error) {
            throw new Error(`Failed to parse JSON response from ${url.toString()}: ${error}`);
        }
    }
  • Helper function 'formatJsonBlock' formats JSON payloads as markdown code blocks, used in the response content of 'get-docs'.
    function formatJsonBlock(title: string, payload: unknown): string {
        return `${title}\n\`\`\`json\n${JSON.stringify(payload, null, 2)}\n\`\`\``;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool retrieves 'complete markdown content including code examples, detailed explanations, and API references,' which gives some context about return format. However, it doesn't disclose potential limitations like authentication requirements, rate limits, error conditions, or whether this is a read-only operation (though implied by 'retrieve').

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?

The description is perfectly concise with two sentences that each serve distinct purposes: the first states the core functionality, the second provides usage guidance. There's no wasted language, and information is front-loaded with the primary purpose stated immediately.

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?

For a single-parameter read operation with no annotations or output schema, the description provides good context about what the tool does and when to use it. It explains the relationship with sibling tools and describes the return content format. However, it doesn't address potential error cases or provide examples of the route parameter format, leaving some gaps in completeness.

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?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It explains that the 'route' parameter corresponds to 'a specific route' for documentation retrieval, adding meaningful context beyond the schema's pattern constraint. However, it doesn't provide examples of valid route formats or explain the pattern requirement.

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?

The description clearly states the specific action ('Retrieve the full documentation content') and resource ('for a specific route'), distinguishing it from sibling tools like 'search-docs' which only finds relevant documentation rather than retrieving complete content. It explicitly mentions what the tool does beyond just the name/title.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs. alternatives: 'After finding relevant documentation with search-docs, use this tool to get the complete markdown content...' This clearly establishes the workflow relationship between sibling tools and specifies the appropriate context for invocation.

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/MenschMachine/pdfdancer-mcp'

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