Skip to main content
Glama
halans

Knowledge Base MCP Server

by halans

list_categories

Retrieve all available topic categories from the knowledge base to understand what subjects are covered and navigate content effectively.

Instructions

List all available categories in the knowledge base. Helpful for understanding what topics are covered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the list_categories tool using server.tool() in src/index.ts.
    // Register the list_categories tool
    server.tool(
      "list_categories",
      "List all available categories in the knowledge base. Helpful for understanding what topics are covered.",
      {},
      async () => {
        try {
          const categories = getCategories();
    
          return {
            content: [
              {
                type: "text" as const,
                text: `# Available Categories\n\nThe knowledge base covers the following topics:\n\n${categories.map((cat) => `- ${cat}`).join("\n")}`,
              },
            ],
          };
        } catch (error) {
          const errorMessage =
            error instanceof Error ? error.message : "Unknown error";
          return {
            content: [
              {
                type: "text" as const,
                text: `Error listing categories: ${errorMessage}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • The getCategories helper function that performs the core logic for the list_categories tool.
     * Get all available categories
     */
    export function getCategories(): string[] {
      const knowledge = getKnowledge();
      const categories = new Set<string>();
      
      for (const chunk of knowledge.chunks) {
        categories.add(chunk.category);
      }
      
      return Array.from(categories).sort();
    }
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 this is a list operation but doesn't cover critical aspects like whether it returns a paginated response, if there are rate limits, authentication requirements, or what the output format looks like. This leaves significant gaps for an agent to use it effectively.

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 two concise sentences with zero waste: the first states the core purpose, and the second adds a brief usage hint. It's front-loaded with the main action and efficiently structured without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a list operation. It doesn't explain what the return values are (e.g., list format, fields included), behavioral traits like pagination or sorting, or error conditions. This makes it inadequate for an agent to fully understand how to handle the tool's output.

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 tool has 0 parameters, and the schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it appropriately doesn't mention any. A baseline of 4 is applied for zero parameters, as it avoids unnecessary detail.

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 verb 'List' and resource 'all available categories in the knowledge base', making the purpose specific and understandable. However, it doesn't explicitly distinguish this tool from its siblings (get_chunk, search_knowledge) in terms of scope or function, 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 Guidelines2/5

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

The description includes 'Helpful for understanding what topics are covered', which implies usage for topic exploration, but provides no explicit guidance on when to use this tool versus alternatives like search_knowledge or get_chunk. There are no prerequisites, exclusions, or named alternatives mentioned.

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/halans/local-mcp-simple'

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