Skip to main content
Glama

get_usage

Retrieve API usage data including search counts and per-user breakdowns. Filter by specific months to analyze platform consumption patterns.

Instructions

Get API usage data. Returns search counts and per-user breakdowns. Optionally filter by month.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
monthNoMonth to query (YYYY-MM format). Omit to get the last 12 months.

Implementation Reference

  • The registration and handler implementation for the 'get_usage' tool.
    export function register(server: McpServer) {
      server.tool(
        "get_usage",
        "Get API usage data. Returns search counts and per-user breakdowns. Optionally filter by month.",
        {
          month: z
            .string()
            .regex(/^\d{4}-\d{2}$/, "Must be YYYY-MM")
            .optional()
            .describe("Month to query (YYYY-MM format). Omit to get the last 12 months."),
        },
        async (params) => {
          try {
            const query = params.month ? `?month=${params.month}` : "";
            const data = await apiGet(`/usage${query}`);
            return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
          } catch (e) {
            return { content: [{ type: "text", text: String(e) }], isError: true };
          }
        }
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool returns 'search counts and per-user breakdowns,' which gives some behavioral context, but lacks critical details: it doesn't specify the response format, whether data is aggregated or real-time, if there are rate limits, or what permissions are required. For a usage reporting tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is concise and front-loaded: the first sentence states the core purpose, followed by details on returns and filtering. There's no wasted text. However, it could be slightly more structured by separating usage scenarios from parameter notes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a usage reporting tool, no annotations, and no output schema, the description is incomplete. It doesn't explain the return values in detail (e.g., format of 'search counts and per-user breakdowns'), potential errors, or system constraints. This leaves significant gaps for an agent to invoke the tool 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 schema description coverage is 100%, so the schema fully documents the single parameter 'month.' The description adds marginal value by noting that filtering by month is optional and that omitting it returns 'the last 12 months,' which clarifies the default behavior. This aligns with the baseline score of 3 when the schema does most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get API usage data' specifies the verb and resource. It distinguishes itself from siblings by focusing on usage metrics rather than searches, integrations, or users. However, it doesn't explicitly differentiate from all siblings (e.g., 'get_user_search' might also return usage-like data).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions optional filtering by month but doesn't specify when filtering is appropriate or compare this tool to any sibling tools for usage-related queries. The agent receives no help in tool selection.

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/rolliinc/rolli-mcp'

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