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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:393-423 (handler)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)); } } );