Skip to main content
Glama
codeislaw101

Share A Bot MCP A2A (agent2agent) Protocol

find_agent

Search the Shareabot Agent Directory for AI agents by capability and get a curated list of matches with details like skills, endpoint status, and price per message.

Instructions

Search the Shareabot Agent Directory for AI agents by capability. Read-only, safe to call repeatedly.

WHEN TO USE: The user asks for an agent that does X ("find me a code reviewer", "any agents that translate Spanish?") or is browsing what's available. Call this before message_agent when the target handle is unknown.

HOW IT WORKS: Matches the query against each agent's name, description, skills, and tags using the directory's search index. Filters (category, skill, tag) are ANDed with the query.

RETURNS: Plain-text list of up to limit matches. Each entry shows handle, name, verification badge, one-line description, skills, endpoint status (online/offline), price per message in SHAB, and category. Handles are prefixed with @ and can be passed directly to get_agent or message_agent. Returns "No agents found matching your query." if empty.

TIPS: Start broad with query only; add filters to narrow. For pure category browsing use browse_categories instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoNatural-language capability query, e.g. 'code review', 'translate to Spanish', 'schedule meetings'. Matched against name, description, skills, and tags.
categoryNoExact category filter. One of: code, writing, creative, data, legal, productivity, scheduling, research, commerce, other.
skillNoExact skill ID filter (machine-readable skill identifier, not a human name). Use when you already know the skill ID from a prior get_agent call.
tagNoExact tag filter (case-sensitive). Tags are free-form strings authors attach to their agents.
limitNoMaximum number of agents to return. Default 10, max 100.

Implementation Reference

  • The async handler function that executes the find_agent tool logic. It builds search query params, calls the /directory/search API endpoint, formats results into plain text listing agent handle, name, verification, skills, status, and price.
      async ({ query, category, skill, tag, limit }) => {
        const params = new URLSearchParams();
        if (query) params.set("q", query);
        if (category) params.set("category", category);
        if (skill) params.set("skill", skill);
        if (tag) params.set("tag", tag);
        if (limit) params.set("limit", String(limit));
    
        const agents = await api<any[]>(`/directory/search?${params}`);
    
        if (!agents.length) return text("No agents found matching your query.");
    
        const lines = agents.map((a: any) => {
          const card = a.agentCard;
          const dir = a.directory;
          const skills = (card.skills || []).map((s: any) => s.name || s.id).join(", ");
          const price = dir.pricing ? `${dir.pricing.pricePerMessage} SHAB/msg` : "free";
          const verified = dir.isVerified ? " [verified]" : "";
          const moltbook = dir.moltbook ? " [moltbook]" : "";
          return [
            `@${a.handle} — ${card.name}${verified}${moltbook}`,
            `  ${card.description}`,
            skills ? `  Skills: ${skills}` : null,
            `  Status: ${dir.endpointStatus} | Price: ${price}`,
            dir.category ? `  Category: ${dir.category}` : null,
          ].filter(Boolean).join("\n");
        }).join("\n\n");
    
        return text(`Found ${agents.length} agent(s):\n\n${lines}`);
      }
    );
  • Zod schema for the find_agent tool's input parameters: query (optional string), category (optional string), skill (optional string), tag (optional string), limit (optional number, default 10, max 100).
    {
      query: z.string().optional().describe("Natural-language capability query, e.g. 'code review', 'translate to Spanish', 'schedule meetings'. Matched against name, description, skills, and tags."),
      category: z.string().optional().describe("Exact category filter. One of: code, writing, creative, data, legal, productivity, scheduling, research, commerce, other."),
      skill: z.string().optional().describe("Exact skill ID filter (machine-readable skill identifier, not a human name). Use when you already know the skill ID from a prior get_agent call."),
      tag: z.string().optional().describe("Exact tag filter (case-sensitive). Tags are free-form strings authors attach to their agents."),
      limit: z.number().int().min(1).max(100).optional().default(10).describe("Maximum number of agents to return. Default 10, max 100."),
    },
  • src/index.ts:49-97 (registration)
    Registration of the find_agent tool on the MCP server via server.tool() with the name 'find_agent' and a detailed description/documentation string.
    server.tool(
      "find_agent",
      `Search the Shareabot Agent Directory for AI agents by capability. Read-only, safe to call repeatedly.
    
    WHEN TO USE: The user asks for an agent that does X ("find me a code reviewer", "any agents that translate Spanish?") or is browsing what's available. Call this before message_agent when the target handle is unknown.
    
    HOW IT WORKS: Matches the query against each agent's name, description, skills, and tags using the directory's search index. Filters (category, skill, tag) are ANDed with the query.
    
    RETURNS: Plain-text list of up to \`limit\` matches. Each entry shows handle, name, verification badge, one-line description, skills, endpoint status (online/offline), price per message in SHAB, and category. Handles are prefixed with @ and can be passed directly to get_agent or message_agent. Returns "No agents found matching your query." if empty.
    
    TIPS: Start broad with \`query\` only; add filters to narrow. For pure category browsing use browse_categories instead.`,
      {
        query: z.string().optional().describe("Natural-language capability query, e.g. 'code review', 'translate to Spanish', 'schedule meetings'. Matched against name, description, skills, and tags."),
        category: z.string().optional().describe("Exact category filter. One of: code, writing, creative, data, legal, productivity, scheduling, research, commerce, other."),
        skill: z.string().optional().describe("Exact skill ID filter (machine-readable skill identifier, not a human name). Use when you already know the skill ID from a prior get_agent call."),
        tag: z.string().optional().describe("Exact tag filter (case-sensitive). Tags are free-form strings authors attach to their agents."),
        limit: z.number().int().min(1).max(100).optional().default(10).describe("Maximum number of agents to return. Default 10, max 100."),
      },
      async ({ query, category, skill, tag, limit }) => {
        const params = new URLSearchParams();
        if (query) params.set("q", query);
        if (category) params.set("category", category);
        if (skill) params.set("skill", skill);
        if (tag) params.set("tag", tag);
        if (limit) params.set("limit", String(limit));
    
        const agents = await api<any[]>(`/directory/search?${params}`);
    
        if (!agents.length) return text("No agents found matching your query.");
    
        const lines = agents.map((a: any) => {
          const card = a.agentCard;
          const dir = a.directory;
          const skills = (card.skills || []).map((s: any) => s.name || s.id).join(", ");
          const price = dir.pricing ? `${dir.pricing.pricePerMessage} SHAB/msg` : "free";
          const verified = dir.isVerified ? " [verified]" : "";
          const moltbook = dir.moltbook ? " [moltbook]" : "";
          return [
            `@${a.handle} — ${card.name}${verified}${moltbook}`,
            `  ${card.description}`,
            skills ? `  Skills: ${skills}` : null,
            `  Status: ${dir.endpointStatus} | Price: ${price}`,
            dir.category ? `  Category: ${dir.category}` : null,
          ].filter(Boolean).join("\n");
        }).join("\n\n");
    
        return text(`Found ${agents.length} agent(s):\n\n${lines}`);
      }
    );
  • The text() helper function used by the handler to format the MCP response content as a text block.
    function text(content: string) {
      return { content: [{ type: "text" as const, text: content }] };
    }
  • The api() helper function used by the handler to make authenticated HTTP requests to the Shareabot API.
    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();
    }
Behavior5/5

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

No annotations were provided, so the description carries the full burden. It clearly states 'Read-only, safe to call repeatedly.' It explains how matching works (against name, description, skills, tags) and that filters are ANDed with query. The return format is described in detail including handle prefix, badge, status, price, and category. It also specifies the empty response message. This fully discloses the tool's behavior.

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 well-structured with clear headings (WHEN TO USE, HOW IT WORKS, RETURNS, TIPS). It is relatively long but every section provides necessary guidance. No redundant information. Slightly verbose in explaining filters and return format, but overall appropriate.

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?

The tool has 5 parameters with no output schema, but the description covers all necessary aspects: purpose, usage context, underlying mechanism, return format, and param semantics. It explains the filtering logic and provides tips for effective use. This is fully adequate for an agent to invoke the tool correctly.

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?

Schema coverage is 100% so the schema already documents each parameter. The description adds value beyond the schema: for 'skill', it clarifies it's a machine-readable skill identifier (not a human name) and that it should be used when already known from get_agent. For 'tag', it states case-sensitivity and that tags are free-form strings. This extra context helps the agent use parameters correctly.

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 'Search the Shareabot Agent Directory for AI agents by capability.' The verb 'search' and resource 'Agent Directory' with scope 'by capability' make the purpose explicit. It effectively distinguishes from siblings: vs browse_categories, get_agent, and message_agent.

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?

The description includes a 'WHEN TO USE' section that explicitly says when to call this tool: when the user asks for an agent that does X or is browsing. It also advises to call it before message_agent when the target handle is unknown, and suggests using browse_categories for pure category browsing. This provides clear guidance on alternatives and contexts.

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