Skip to main content
Glama

browse_categories

Browse and list all API categories in the CLIRank directory to discover available API types and their counts for AI agent integration.

Instructions

List all API categories in the CLIRank directory with the number of APIs in each.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the 'browse_categories' tool. It fetches API category data and formats it as a Markdown table.
    // Tool 5: browse_categories
    server.tool(
      "browse_categories",
      "List all API categories in the CLIRank directory with the number of APIs in each.",
      {},
      async () => {
        try {
          const data = await apiGet<ApisResponse>("/apis", { limit: "1" });
    
          const lines = [
            "## API Categories\n",
            "| Category | APIs |",
            "|----------|------|",
          ];
    
          const sorted = data.categories.sort((a, b) => b.count - a.count);
          for (const cat of sorted) {
            lines.push(`| ${cat.name} | ${cat.count} |`);
          }
    
          lines.push("");
          lines.push(`Total: ${sorted.reduce((sum, c) => sum + c.count, 0)} APIs across ${sorted.length} categories`);
          lines.push("");
          lines.push("Use discover_apis to search within a category, or get_api_details with a slug for full info.");
    
          return textResult(lines.join("\n"));
        } catch (err) {
          return errorResult(err instanceof Error ? err.message : String(err));
        }
      }
    );

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/alexanderclapp/clirank-mcp-server'

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