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 };
          }
        }
      );
    }

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