Skip to main content
Glama

get_docs_by_category

Retrieve structured documentation by category to explore guides, concepts, development resources, and specifications for building MCP servers and clients.

Instructions

Get documentation organized by category. Returns structured overview of available documentation in each area.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesThe documentation category to explore

Implementation Reference

  • Main handler implementation: defines the tool object with execute method that scans documentation files, categorizes them based on filename heuristics, extracts metadata, and returns a structured Markdown overview by category.
    export const getDocsByCategory = {
      name: "get_docs_by_category",
      description: "Get documentation organized by category. Returns structured overview of available documentation in each area.",
      inputSchema: inputSchema.shape,
      
      async execute(args: z.infer<typeof inputSchema>) {
        const { category } = args;
        
        try {
          const docsPath = docsDirectory;
          const files = readdirSync(docsPath).filter(file => file.endsWith('.md'));
          
          if (category === "overview") {
            // Return overview of all categories
            const categoryStats: Record<string, DocInfo[]> = {
              getting_started: [],
              concepts: [],
              development: [],
              specification: [],
              tools: [],
              community: []
            };
            
            for (const file of files) {
              const filePath = join(docsPath, file);
              const content = readFileSync(filePath, 'utf-8');
              const fileCategory = categorizeFile(file);
              
              if (fileCategory in categoryStats) {
                categoryStats[fileCategory].push({
                  file,
                  title: extractTitle(content),
                  description: extractDescription(content),
                  uri: `mcp-docs://${file}`
                });
              }
            }
            
            let response = `# 📚 MCP Documentation Overview\n\n`;
            response += `## Available Documentation Categories\n\n`;
            
            const categoryDescriptions = {
              getting_started: "🚀 **Getting Started** - Introduction to MCP and basic concepts",
              concepts: "🧠 **Core Concepts** - Architecture, primitives, and design principles", 
              development: "🛠️ **Development** - Building servers and clients",
              specification: "📋 **Protocol Specification** - Technical protocol details",
              tools: "🔧 **Tools & Debugging** - Development tools and troubleshooting",
              community: "👥 **Community** - Governance, communication, and contribution guidelines"
            };
            
            for (const [cat, docs] of Object.entries(categoryStats)) {
              if (docs.length > 0) {
                response += `### ${categoryDescriptions[cat as keyof typeof categoryDescriptions]}\n`;
                response += `*${docs.length} document${docs.length === 1 ? '' : 's'} available*\n\n`;
                
                for (const doc of docs.slice(0, 5)) {
                  response += `- **${doc.title}** - ${doc.description}\n`;
                  response += `  *Resource*: \`${doc.uri}\`\n`;
                }
                
                if (docs.length > 5) {
                  response += `  *... and ${docs.length - 5} more documents*\n`;
                }
                response += `\n`;
              }
            }
            
            response += `## 🎯 Quick Actions\n\n`;
            response += `- **Search**: Use \`search_docs("your query")\` to find specific information\n`;
            response += `- **Browse by category**: Use \`get_docs_by_category("category_name")\`\n`;
            response += `- **Get guidance**: Use \`mcp_docs_guide("topic")\` for structured guides\n`;
            response += `- **Access full document**: Use resources like \`mcp-docs://filename.md\`\n\n`;
            
            response += `## 📖 Recommended Reading Path\n\n`;
            response += `1. **Start here**: Getting started documentation\n`;
            response += `2. **Understand**: Core concepts and architecture\n`;
            response += `3. **Build**: Development guides for servers/clients\n`;
            response += `4. **Reference**: Protocol specification when needed\n`;
            response += `5. **Debug**: Tools and troubleshooting guides\n`;
            
            return {
              content: [{
                type: "text" as const,
                text: response
              }]
            };
          }
          
          // Return specific category
          const categoryDocs: DocInfo[] = [];
          
          for (const file of files) {
            const filePath = join(docsPath, file);
            const content = readFileSync(filePath, 'utf-8');
            const fileCategory = categorizeFile(file);
            
            if (fileCategory === category) {
              categoryDocs.push({
                file,
                title: extractTitle(content),
                description: extractDescription(content),
                uri: `mcp-docs://${file}`
              });
            }
          }
          
          if (categoryDocs.length === 0) {
            return {
              content: [{
                type: "text" as const,
                text: `No documentation found in category "${category}".
    
    Available categories:
    - getting_started: Introduction and basics
    - concepts: Architecture and design principles
    - development: Building servers and clients
    - specification: Technical protocol details
    - tools: Development tools and debugging
    - community: Governance and contribution guidelines`
              }]
            };
          }
          
          // Format category-specific response
          const categoryTitles = {
            getting_started: "🚀 Getting Started with MCP",
            concepts: "🧠 MCP Core Concepts",
            development: "🛠️ MCP Development",
            specification: "📋 Protocol Specification",
            tools: "🔧 Tools & Debugging",
            community: "👥 Community & Governance"
          };
          
          let response = `# ${categoryTitles[category as keyof typeof categoryTitles]}\n\n`;
          response += `## ${categoryDocs.length} Document${categoryDocs.length === 1 ? '' : 's'} Available\n\n`;
          
          // Group by subcategory if applicable
          const subcategories: Record<string, DocInfo[]> = {};
          
          for (const doc of categoryDocs) {
            let subcategory = "General";
            
            if (category === "concepts") {
              if (doc.file.includes("architecture")) subcategory = "Architecture";
              else if (doc.file.includes("tools")) subcategory = "Tools";
              else if (doc.file.includes("resources")) subcategory = "Resources";
              else if (doc.file.includes("prompts")) subcategory = "Prompts";
              else if (doc.file.includes("transports")) subcategory = "Transports";
            } else if (category === "development") {
              if (doc.file.includes("server")) subcategory = "Server Development";
              else if (doc.file.includes("client")) subcategory = "Client Development";
              else if (doc.file.includes("connect")) subcategory = "Connection Setup";
            } else if (category === "specification") {
              if (doc.file.includes("basic")) subcategory = "Base Protocol";
              else if (doc.file.includes("server")) subcategory = "Server Features";
              else if (doc.file.includes("client")) subcategory = "Client Features";
            }
            
            if (!subcategories[subcategory]) {
              subcategories[subcategory] = [];
            }
            subcategories[subcategory].push(doc);
          }
          
          // Display by subcategory
          for (const [subcat, docs] of Object.entries(subcategories)) {
            if (Object.keys(subcategories).length > 1) {
              response += `### ${subcat}\n\n`;
            }
            
            for (const doc of docs) {
              response += `#### ${doc.title}\n`;
              response += `${doc.description}\n\n`;
              response += `**📄 Resource**: \`${doc.uri}\`\n`;
              response += `**📁 File**: \`${doc.file}\`\n\n`;
            }
          }
          
          response += `## 🔗 Related Actions\n\n`;
          response += `- **Search within category**: \`search_docs("query", "${category}")\`\n`;
          response += `- **Get structured guide**: \`mcp_docs_guide("${category === 'getting_started' ? 'getting_started' : 'core_concepts'}")\`\n`;
          response += `- **View all categories**: \`get_docs_by_category("overview")\`\n`;
          
          return {
            content: [{
              type: "text" as const,
              text: response
            }]
          };
          
        } catch (error) {
          return {
            content: [{
              type: "text" as const,
              text: `Error accessing documentation: ${error instanceof Error ? error.message : String(error)}`
            }]
          };
        }
      }
    };
  • Zod input schema defining the required 'category' parameter as an enum of available documentation categories.
    const inputSchema = z.object({
      category: z.enum([
        "overview",
        "getting_started",
        "concepts", 
        "development",
        "specification",
        "tools",
        "community"
      ]).describe("The documentation category to explore")
    });
  • src/index.ts:155-178 (registration)
    Tool registration in ListToolsRequestHandler: provides the JSON schema, name, and description for tool discovery.
    {
      name: "get_docs_by_category",
      description:
        "Get documentation organized by category. Returns structured overview of available documentation in each area.",
      inputSchema: {
        type: "object",
        properties: {
          category: {
            type: "string",
            enum: [
              "overview",
              "getting_started",
              "concepts",
              "development",
              "specification",
              "tools",
              "community",
            ],
            description: "The documentation category to explore",
          },
        },
        required: ["category"],
      },
    },
  • src/index.ts:195-196 (registration)
    Tool execution handler in CallToolRequestHandler switch statement: dispatches to the tool's execute method.
    case "get_docs_by_category":
      return await getDocsByCategory.execute(args as any);
  • Helper function to categorize documentation files based on filename keywords for grouping.
    function categorizeFile(filename: string): string {
      if (filename.includes("getting-started") || filename.includes("intro")) {
        return "getting_started";
      } else if (filename.includes("concepts") || filename.includes("learn") || filename.includes("architecture")) {
        return "concepts";
      } else if (filename.includes("develop") || filename.includes("build") || filename.includes("connect")) {
        return "development";
      } else if (filename.includes("basic") || filename.includes("server") || filename.includes("client") || filename.includes("specification")) {
        return "specification";
      } else if (filename.includes("tools") || filename.includes("debugging") || filename.includes("inspector")) {
        return "tools";
      } else if (filename.includes("community") || filename.includes("governance") || filename.includes("communication")) {
        return "community";
      }
      return "other";
    }
Behavior2/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 states the tool returns a 'structured overview,' which hints at the output format, but lacks details on permissions, rate limits, error handling, or whether the operation is read-only (implied by 'get' but not confirmed).

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

Conciseness4/5

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

The description is concise and front-loaded, with two sentences that directly state the tool's purpose and output. There is no wasted text, though it could be slightly more informative without losing efficiency.

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 has gaps. It covers the basic purpose and output hint, but lacks behavioral details and usage guidelines, making it minimally viable but not fully comprehensive.

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%, with the parameter 'category' fully documented in the schema, including its enum values. The description adds no additional parameter semantics beyond what the schema provides, so the baseline score of 3 is appropriate.

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: 'Get documentation organized by category' specifies the verb (get) and resource (documentation). It distinguishes from 'search_docs' by focusing on categorical retrieval rather than keyword search, though differentiation from 'mcp_docs_guide' is less explicit.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives is provided. The description mentions 'Returns structured overview of available documentation in each area,' which implies a browsing use case, but it doesn't specify when to choose this over 'search_docs' or 'mcp_docs_guide'.

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/glassBead-tc/mcp-docs-server'

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