get_api_details
Retrieve comprehensive API details including scores, pricing, authentication methods, capabilities, and quality breakdowns by specifying the API slug.
Instructions
Get full details for a specific API by its slug. Returns scores, pricing, auth method, capabilities, and quality breakdown.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | API slug, e.g. 'stripe-api', 'openai-api' |
Implementation Reference
- src/index.ts:175-210 (handler)The handler for get_api_details tool. Fetches API details and formats them into a markdown string.
async ({ slug }) => { try { // Fetch the API via the apis endpoint with name search const data = await apiGet<ApisResponse>("/apis", { q: slug, limit: "5" }); // Try exact slug match first, then closest match const api = data.apis.find(a => slugify(a.name) === slug) || data.apis[0]; if (!api) { return errorResult(`No API found with slug "${slug}". Use discover_apis to search.`); } const lines = [ `## ${api.name}`, "", api.description, "", `| Field | Value |`, `|-------|-------|`, `| Category | ${api.category} / ${api.subcategory} |`, `| Pricing | ${api.pricing} |`, `| CLI Relevance | ${api.cliRelevanceScore ?? "N/A"}/10 |`, `| Quality Score | ${api.qualityScore ?? "N/A"}/10 |`, `| Overall Score | ${api.overallScore ?? "N/A"} |`, `| npm Package | ${api.npmPackage || "N/A"} |`, `| Weekly Downloads | ${api.weeklyDownloads?.toLocaleString() ?? "N/A"} |`, `| URL | ${api.url} |`, ]; if (api.capabilities.length) { lines.push("", `Capabilities: ${api.capabilities.join(", ")}`); } if (api.dataTypes.length) { lines.push(`Data Types: ${api.dataTypes.join(", ")}`); } - src/index.ts:169-174 (registration)Registration of the get_api_details tool with input schema validation for 'slug'.
server.tool( "get_api_details", "Get full details for a specific API by its slug. Returns scores, pricing, auth method, capabilities, and quality breakdown.", { slug: z.string().describe("API slug, e.g. 'stripe-api', 'openai-api'"), },