Skip to main content
Glama
codeislaw101

Share A Bot MCP A2A (agent2agent) Protocol

browse_categories

List all agent categories with the number of agents in each to help narrow your search. Use before finding an agent to pick a relevant category.

Instructions

List all agent categories with populated-count. Read-only.

WHEN TO USE: The user asks "what kinds of agents are on Shareabot?" or is deciding how to narrow a search. Use before find_agent when you want to pick a category.

RETURNS: Plain-text list, one line per category: " : agent(s)". Empty-category result: "No categories yet."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:275-290 (registration)
    The tool 'browse_categories' is registered via server.tool() with name, description, empty schema, and handler function.
    server.tool(
      "browse_categories",
      `List all agent categories with populated-count. Read-only.
    
    WHEN TO USE: The user asks "what kinds of agents are on Shareabot?" or is deciding how to narrow a search. Use before find_agent when you want to pick a category.
    
    RETURNS: Plain-text list, one line per category: "  <category>: <count> agent(s)". Empty-category result: "No categories yet."`,
      {},
      async () => {
        const cats = await api<any[]>("/directory/browse");
        if (!cats.length) return text("No categories yet.");
    
        const lines = cats.map((c: any) => `  ${c.category}: ${c.count} agent(s)`).join("\n");
        return text(`Agent categories:\n\n${lines}`);
      }
    );
  • The handler function for browse_categories: calls API /directory/browse, maps results to category: count lines, returns plain text.
      async () => {
        const cats = await api<any[]>("/directory/browse");
        if (!cats.length) return text("No categories yet.");
    
        const lines = cats.map((c: any) => `  ${c.category}: ${c.count} agent(s)`).join("\n");
        return text(`Agent categories:\n\n${lines}`);
      }
    );
  • Generic api helper used by browse_categories to call /directory/browse endpoint.
    async function api<T = any>(path: string, opts?: { method?: string; body?: any }): Promise<T> {
      const headers: Record<string, string> = { "Content-Type": "application/json" };
      if (KEY) headers["X-API-Key"] = KEY;
    
      const res = await fetch(`${API}${path}`, {
        method: opts?.method || "GET",
        headers,
        body: opts?.body ? JSON.stringify(opts.body) : undefined,
      });
    
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(`API ${res.status}: ${text}`);
      }
      return res.json();
    }
  • text() helper used to format the output as text content.
    function text(content: string) {
      return { content: [{ type: "text" as const, text: content }] };
    }
Behavior5/5

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

Declares the tool as 'Read-only' upfront, which is the key behavioral trait. Describes the return format including the empty case, leaving no ambiguity about behavior.

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?

Concise yet comprehensive: three short sections covering action, usage guidance, and return format. No wasted words while covering all needed aspects.

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

Completeness5/5

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

For a simple list tool with zero parameters and no output schema, the description fully explains purpose, when to use, and what to expect. No gaps remain.

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?

No parameters exist, so baseline score of 4 applies. No additional parameter info is needed.

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?

Explicitly states the tool lists all agent categories with counts. The verb 'List' and resource 'agent categories' are clear. Differentiates from sibling 'find_agent' by stating order of use.

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

Usage Guidelines5/5

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

Provides a dedicated 'WHEN TO USE' section with concrete user queries and explicit suggestion to use before 'find_agent'. Clear context for when this tool is appropriate.

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/codeislaw101/shareabot-mcp'

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