Skip to main content
Glama

get_page

Fetch full content from Fumadocs documentation pages by providing a specific path to access detailed technical information.

Instructions

Fetch the full content of a specific Fumadocs documentation page. Provide the path (e.g., '/docs/manual-installation/next') to get detailed documentation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDocumentation path (e.g., '/docs/manual-installation/next' or '/docs/ui/components/tabs')

Implementation Reference

  • Main handler function getPage that fetches and returns documentation page content. It validates input, normalizes paths, handles errors, and formats the output with metadata including the source URL.
    export async function getPage(params: GetPageParams): Promise<string> {
      const { path } = params;
    
      if (!path || path.trim().length === 0) {
        return "Error: Please provide a documentation path.";
      }
    
      // Normalize path
      let normalizedPath = path.trim();
      if (!normalizedPath.startsWith("/")) {
        normalizedPath = "/" + normalizedPath;
      }
      if (!normalizedPath.startsWith("/docs")) {
        normalizedPath = "/docs" + normalizedPath;
      }
    
      try {
        const content = await fetchPage(normalizedPath);
    
        if (!content || content.trim().length === 0) {
          return `No content found at path: ${normalizedPath}\n\nTry using \`search_docs\` to find the correct path.`;
        }
    
        const output: string[] = [
          `# Documentation: ${normalizedPath}\n`,
          "---\n",
          content,
          "\n---",
          `\nSource: https://fumadocs.vercel.app${normalizedPath}`,
        ];
    
        return output.join("\n");
      } catch (error) {
        if (error instanceof FumadocsError) {
          if (error.code === "PAGE_NOT_FOUND") {
            return [
              `Page not found: ${normalizedPath}`,
              "",
              "The requested documentation page does not exist.",
              "",
              "Suggestions:",
              "- Check if the path is correct",
              "- Use `search_docs` to find the right page",
              "- Use `list_topics` to browse available pages",
            ].join("\n");
          }
    
          return `Error fetching page: ${error.message} (${error.code})`;
        }
    
        return `Unexpected error fetching page: ${error instanceof Error ? error.message : "Unknown error"}`;
      }
    }
  • Schema definition for get_page tool using Zod validation and TypeScript type definition for input parameters. The schema expects a 'path' string parameter for documentation paths.
    export const getPageSchema = {
      path: z
        .string()
        .describe("Documentation path (e.g., '/docs/manual-installation/next' or '/docs/ui/components/tabs')"),
    };
    
    export type GetPageParams = {
      path: string;
    };
  • src/index.ts:52-63 (registration)
    MCP tool registration for get_page in the main server file. The tool is registered with its name, description, schema, and async handler that wraps the getPage function and formats the response.
    // Register get_page tool
    server.tool(
      "get_page",
      "Fetch the full content of a specific Fumadocs documentation page. Provide the path (e.g., '/docs/manual-installation/next') to get detailed documentation.",
      getPageSchema,
      async (params) => {
        const result = await getPage(params);
        return {
          content: [{ type: "text", text: result }],
        };
      }
    );
  • Helper function fetchPage that implements the actual fetching logic. It first checks cache, then tries to fetch from llms-full.txt, and falls back to direct HTML fetching with content extraction.
    export async function fetchPage(path: string): Promise<string> {
      // Normalize path
      const normalizedPath = path.startsWith("/") ? path : `/${path}`;
      const cacheKey = `page:${normalizedPath}`;
    
      const cached = cache.get<string>(cacheKey);
      if (cached) {
        return cached;
      }
    
      // Try fetching from llms-full.txt first (contains all docs in markdown)
      try {
        const fullDocs = await fetchLlmsFullTxt();
        const pageContent = extractPageFromFullDocs(fullDocs, normalizedPath);
        if (pageContent) {
          cache.set(cacheKey, pageContent, "PAGE_CONTENT");
          return pageContent;
        }
      } catch {
        // Fall through to direct fetch
      }
    
      // Fallback: fetch the HTML page directly
      const url = `${FUMADOCS_BASE_URL}${normalizedPath}`;
      const html = await fetchWithRetry(url);
      const content = extractContentFromHtml(html);
      cache.set(cacheKey, content, "PAGE_CONTENT");
      return content;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool fetches content but lacks details on permissions, rate limits, error handling, or response format. For a read operation with no annotation coverage, this is a significant gap in transparency about how the tool behaves beyond its basic function.

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 front-loaded with the core purpose in the first sentence and uses a second sentence to clarify the parameter usage, with no wasted words. It is appropriately sized for a single-parameter tool, making it efficient and easy to parse.

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?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and parameter usage but lacks behavioral context like response details or error cases. For a read tool with no output schema, more information on what is returned would improve completeness.

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?

The schema description coverage is 100%, with the parameter 'path' fully documented in the schema. The description adds minimal value by providing an example ('/docs/manual-installation/next') but does not explain semantics beyond what the schema already states, such as path formatting rules or constraints. This meets the baseline for high schema coverage.

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 ('Fetch the full content') and resource ('a specific Fumadocs documentation page'), distinguishing it from siblings like 'list_topics' (which lists topics) and 'search_docs' (which searches). It explicitly mentions the type of content retrieved ('detailed documentation'), making the purpose unambiguous.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('to get detailed documentation' for a specific page), but it does not explicitly state when not to use it or name alternatives. For example, it doesn't clarify that 'get_component' might be for UI components or 'get_setup_guide' for setup instructions, leaving some ambiguity in sibling differentiation.

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/k4cper-g/fumadocs-mcp'

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