Skip to main content
Glama

get_service_stats

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 },
    },
  • 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);
    }
  • 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;
    }
  • 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) }] };
    }
  • 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") : "✅ 全ての認証情報が設定されています。",
Behavior5/5

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

The description adds behavioral context beyond annotations: it states that no authentication is required and specifies the return format as an array of objects with fields { serviceId, callCount, totalRevenueUsdc, lastCalledAt }. Annotations already indicate readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true, and the description does not contradict them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise with three short sentences that are front-loaded with the core purpose. Every sentence adds value: purpose, usage order, and return format. No wasted words.

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?

Given the tool has no input parameters and no output schema, the description is complete. It explains the return structure and positions the tool within a typical workflow (after list_services, before call_service). This is sufficient for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters and schema description coverage is 100%. With zero parameters, the description cannot add further parameter semantics. A baseline score of 3 is appropriate.

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 what the tool does with a specific verb and resource: 'Return public usage statistics for every approved service on the marketplace.' It distinguishes itself from sibling tools like list_servicess (which lists services) and call_service (which invokes a service).

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 provides explicit usage guidance: '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).' This clearly informs the AI agent when and why to use this tool over alternatives.

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/evidai/lemon-cake'

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