Skip to main content
Glama

get_setup_guide

Get framework-specific setup instructions for adding Fumadocs to existing projects using Next.js, React Router, TanStack Start, or Waku.

Instructions

Get a complete setup guide for adding Fumadocs to an existing project. Specify the framework (next, react-router, tanstack-start, or waku) to get framework-specific instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkYesThe framework to get installation instructions for
includeUINoWhether to include Fumadocs UI setup instructions (default: true)

Implementation Reference

  • Main handler function getSetupGuide that executes the tool logic - fetches framework-specific installation guides from Fumadocs documentation, optionally includes UI setup, and returns a formatted guide with resources.
    export async function getSetupGuide(params: GetSetupGuideParams): Promise<string> {
      const { framework, includeUI = true } = params;
    
      const frameworkPath = FRAMEWORK_PATHS[framework];
      if (!frameworkPath) {
        return `Unknown framework: ${framework}. Available: next, react-router, tanstack-start, waku`;
      }
    
      const frameworkNames: Record<string, string> = {
        next: "Next.js",
        "react-router": "React Router",
        "tanstack-start": "Tanstack Start",
        waku: "Waku",
      };
    
      const output: string[] = [
        `# Fumadocs Setup Guide for ${frameworkNames[framework]}`,
        "",
        "This guide will help you add Fumadocs to an existing project.",
        "",
        "---",
        "",
      ];
    
      try {
        // Fetch the main installation guide
        const mainGuide = await fetchPage(frameworkPath);
        output.push("## Installation Steps\n");
        output.push(mainGuide);
    
        // Optionally include UI setup
        if (includeUI) {
          output.push("\n---\n");
          output.push("## Fumadocs UI Setup\n");
    
          try {
            const uiGuide = await fetchPage("/docs/ui");
            output.push(uiGuide);
          } catch {
            output.push("For UI setup, visit: https://fumadocs.vercel.app/docs/ui");
          }
        }
    
        output.push("\n---\n");
        output.push("## Additional Resources\n");
        output.push(`- Full documentation: https://fumadocs.vercel.app${frameworkPath}`);
        output.push("- MDX setup: Use `get_page` with path '/docs/mdx'");
        output.push("- Search setup: Use `get_page` with path '/docs/search'");
        output.push("- Components: Use `get_component` to get component documentation");
    
        return output.join("\n");
      } catch (error) {
        if (error instanceof FumadocsError) {
          return `Error fetching setup guide: ${error.message} (${error.code})`;
        }
        return `Unexpected error: ${error instanceof Error ? error.message : "Unknown error"}`;
      }
    }
  • Zod schema definition for input validation - requires 'framework' enum (next, react-router, tanstack-start, waku) and optional 'includeUI' boolean parameter.
    export const getSetupGuideSchema = {
      framework: z
        .enum(["next", "react-router", "tanstack-start", "waku"])
        .describe("The framework to get installation instructions for"),
      includeUI: z
        .boolean()
        .optional()
        .describe("Whether to include Fumadocs UI setup instructions (default: true)"),
    };
  • TypeScript type definition GetSetupGuideParams that defines the input parameter structure for type safety.
    export type GetSetupGuideParams = {
      framework: "next" | "react-router" | "tanstack-start" | "waku";
      includeUI?: boolean;
    };
  • src/index.ts:65-76 (registration)
    MCP tool registration where get_setup_guide is registered with the server, including tool description and handler wrapper that returns MCP-formatted content.
    // Register get_setup_guide tool
    server.tool(
      "get_setup_guide",
      "Get a complete setup guide for adding Fumadocs to an existing project. Specify the framework (next, react-router, tanstack-start, or waku) to get framework-specific instructions.",
      getSetupGuideSchema,
      async (params) => {
        const result = await getSetupGuide(params);
        return {
          content: [{ type: "text", text: result }],
        };
      }
    );
  • src/tools/index.ts:4-4 (registration)
    Export statement that re-exports getSetupGuide, getSetupGuideSchema, and GetSetupGuideParams type for use in the main index file.
    export { getSetupGuide, getSetupGuideSchema, type GetSetupGuideParams } from "./get-setup-guide.js";
Behavior3/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 implies a read-only operation by using 'Get', but does not detail aspects like authentication requirements, rate limits, or output format. The description adds some context about framework-specific instructions but lacks comprehensive behavioral traits.

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 efficiently specifies the framework options in the second. Every sentence adds value without redundancy, making it appropriately sized and easy to parse for an AI agent.

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 moderate complexity (2 parameters, no output schema), the description is complete enough for basic usage but lacks details on behavioral aspects like error handling or output structure. It covers the what and how for parameters but does not fully compensate for the absence of annotations or output schema, leaving gaps in operational context.

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 description coverage is 100%, so the schema already documents both parameters (framework and includeUI) with descriptions and enum values. The description mentions the framework parameter but does not add meaning beyond what the schema provides, such as explaining the implications of includeUI or default behaviors. Baseline 3 is appropriate as the schema handles most documentation.

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 ('Get a complete setup guide') and resource ('adding Fumadocs to an existing project'), distinguishing it from sibling tools like get_component or list_topics by focusing on installation instructions rather than content retrieval. It explicitly mentions the target frameworks, making the purpose distinct and actionable.

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: when needing setup instructions for Fumadocs integration with specified frameworks. However, it does not explicitly state when not to use it or name alternatives among sibling tools, such as using search_docs for general documentation queries instead of setup guides.

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