get_service_stats
Retrieve public usage statistics for approved marketplace services to compare call counts, USDC revenue, and last-used timestamps, enabling informed service selection based on real-world traction.
Instructions
Return public usage statistics for every approved service on the marketplace. No authentication required.
Use this AFTER list_services and BEFORE call_service to pick a service based on real-world traction (call counts, USDC revenue, last-used timestamp).
Returns: an array of { serviceId, callCount, totalRevenueUsdc, lastCalledAt }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server/src/index.ts:357-376 (registration)Tool registration in ListToolsRequestSchema handler: defines the 'get_service_stats' tool with name, description, annotations, and an empty inputSchema (no parameters).
// ─── get_service_stats(認証不要) ─────────────────────────────────── { name: "get_service_stats", description: [ "Return public usage statistics for every approved service on the marketplace. No authentication required.", "", "Use this AFTER list_services and BEFORE call_service to pick a service based on", "real-world traction (call counts, USDC revenue, last-used timestamp).", "", "Returns: an array of { serviceId, callCount, totalRevenueUsdc, lastCalledAt }.", ].join("\n"), annotations: { title: "Marketplace usage stats", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, inputSchema: { type: "object", properties: {}, additionalProperties: false }, }, - mcp-server/src/index.ts:558-562 (handler)Tool handler in CallToolRequestSchema: the 'get_service_stats' case calls apiGet('/api/services/stats') and returns the raw JSON result.
// ─── get_service_stats ─────────────────────────────────────────────── case "get_service_stats": { const stats = await apiGet("/api/services/stats"); return json(stats); } - mcp-server/src/index.ts:67-79 (helper)Helper function apiGet used by the handler: performs an authenticated GET request to the LemonCake API and returns the JSON body.
async function apiGet(path: string, auth?: string) { const res = await fetch(`${API_URL}${path}`, { headers: { "Content-Type": "application/json", "User-Agent": USER_AGENT, "X-LemonCake-Client": USER_AGENT, ...(auth ? { Authorization: `Bearer ${auth}` } : {}), }, }); const body = await res.json(); if (!res.ok) throw new Error(`API ${res.status}: ${JSON.stringify(body)}`); return body; } - mcp-server/src/index.ts:98-100 (helper)Helper function json used by the handler: wraps data into the MCP 'text' content response format.
function json(data: unknown) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } - mcp-server/src/index.ts:448-453 (registration)The 'get_service_stats' tool is listed as a noAuth (no authentication required) tool in the setup tool's response.
availableTools: { noAuth: ["setup", "list_services", "get_service_stats", "check_tax"], needPayToken: ["call_service"], needBuyerJwt: ["check_balance"], }, setupSteps: steps.length > 0 ? steps.join("\n") : "✅ 全ての認証情報が設定されています。",