Skip to main content
Glama

list_topics

Browse Fumadocs documentation sections and topics to find specific information. Use this tool to see all available sections or list topics within a particular section.

Instructions

Browse available Fumadocs documentation sections and topics. Use without parameters to see all sections, or specify a section to see all topics in that section.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionNoSection to list topics from, or 'all' for overview

Implementation Reference

  • The main listTopics handler function that executes the tool logic. It accepts an optional section parameter and either shows an overview of all sections (when section='all') or displays all topics within a specific section.
    export async function listTopics(params: ListTopicsParams): Promise<string> {
      const { section = "all" } = params;
    
      if (section === "all") {
        const sections = getAllSections();
        const output: string[] = [
          "# Fumadocs Documentation Topics\n",
          "Available documentation sections:\n",
        ];
    
        for (const sec of sections) {
          output.push(`## ${sec.name} (${sec.id})`);
          output.push(`${sec.entries.length} topics available\n`);
    
          // Show first 5 entries as preview
          const preview = sec.entries.slice(0, 5);
          for (const entry of preview) {
            output.push(`- [${entry.title}](${entry.path}): ${entry.description}`);
          }
    
          if (sec.entries.length > 5) {
            output.push(`- ... and ${sec.entries.length - 5} more topics`);
          }
          output.push("");
        }
    
        output.push("\n---");
        output.push("Use `list_topics` with a specific section to see all topics in that section.");
    
        return output.join("\n");
      }
    
      // Specific section
      const sectionName = SECTIONS[section as SectionId];
      const entries = getEntriesBySection(section as SectionId);
    
      if (entries.length === 0) {
        return `No topics found in section: ${section}`;
      }
    
      const output: string[] = [
        `# ${sectionName} Documentation\n`,
        `${entries.length} topics available:\n`,
      ];
    
      for (const entry of entries) {
        output.push(`## ${entry.title}`);
        output.push(`Path: ${entry.path}`);
        output.push(`${entry.description}\n`);
      }
    
      return output.join("\n");
    }
  • The Zod schema defining the input validation for the list_topics tool. It accepts an optional 'section' parameter that must be one of the allowed values: 'all', 'cli', 'headless', 'framework', 'mdx', or 'ui'.
    export const listTopicsSchema = {
      section: z
        .enum(["all", "cli", "headless", "framework", "mdx", "ui"])
        .optional()
        .describe("Section to list topics from, or 'all' for overview"),
    };
  • TypeScript type definition for the ListTopicsParams, ensuring type safety for the optional section parameter.
    export type ListTopicsParams = {
      section?: "all" | SectionId;
    };
  • src/index.ts:26-37 (registration)
    Registration of the list_topics tool with the MCP server. Defines the tool name, description, schema, and the handler function that wraps the listTopics implementation.
    // Register list_topics tool
    server.tool(
      "list_topics",
      "Browse available Fumadocs documentation sections and topics. Use without parameters to see all sections, or specify a section to see all topics in that section.",
      listTopicsSchema,
      async (params) => {
        const result = await listTopics(params);
        return {
          content: [{ type: "text", text: result }],
        };
      }
    );
  • Helper functions used by the listTopics handler: getEntriesBySection() filters documentation entries by section, and getAllSections() returns all sections with their associated entries.
    export function getEntriesBySection(section: SectionId): DocEntry[] {
      return DOCS_INDEX.filter((entry) => entry.section === section);
    }
    
    // Get all sections with their entries
    export function getAllSections(): { id: SectionId; name: string; entries: DocEntry[] }[] {
      return (Object.keys(SECTIONS) as SectionId[]).map((id) => ({
        id,
        name: SECTIONS[id],
        entries: getEntriesBySection(id),
      }));
    }
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. It describes the tool's behavior: browsing sections and topics, with optional filtering by section. However, it lacks details on output format, pagination, error handling, or performance characteristics. For a read-only tool, this is adequate but not comprehensive, earning a baseline score.

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 highly concise and well-structured in two sentences. The first sentence states the purpose, and the second provides usage instructions. Every word earns its place with no redundancy or fluff, making it easy to parse and understand quickly.

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 (one optional parameter, no output schema, no annotations), the description is complete enough for basic use. It covers purpose and usage but lacks details on output format or behavioral nuances. For a simple browsing tool, this is minimally viable but could be enhanced with more context about what the output looks like.

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 input schema has 100% description coverage, with the 'section' parameter fully documented via enum values. The description adds minimal value beyond the schema, only mentioning that using no parameters shows all sections and specifying a section shows topics in that section. This aligns with the schema but doesn't provide additional semantic context, resulting in the baseline score.

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 clearly states the tool's purpose: 'Browse available Fumadocs documentation sections and topics.' It specifies the verb ('browse') and resource ('documentation sections and topics'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'search_docs' or 'get_page', which prevents a perfect score.

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 usage guidance: 'Use without parameters to see all sections, or specify a section to see all topics in that section.' This explains when to use the tool with or without parameters. However, it doesn't mention when to use this tool versus alternatives like 'search_docs' or 'get_page', which would be needed for a score of 5.

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