Skip to main content
Glama
wave-av

WAVE MCP Server

Official
by wave-av

wave_get_usage

Retrieve current billing period usage for streaming minutes, storage, and bandwidth consumption. Query summary, daily, or by-stream breakdowns.

Instructions

Get current billing period usage including streaming minutes, storage, and bandwidth consumption

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoBilling period to query (default: current)
breakdownNoLevel of usage detail (default: summary)

Implementation Reference

  • The handler function for wave_get_usage tool. It accepts optional 'period' (current|previous) and 'breakdown' (summary|daily|by_stream) parameters, builds URL query params, fetches /api/v1/billing/usage, and returns the response body as text content.
      async ({ period, breakdown }) => {
        const params = new URLSearchParams();
        if (period) params.set("period", period);
        if (breakdown) params.set("breakdown", breakdown);
    
        const query = params.toString();
        const path = `/api/v1/billing/usage${query ? `?${query}` : ""}`;
        const res = await waveFetch(path);
        if (!res.ok) return errorContent(res.status, res.body);
    
        return textContent(res.body);
      },
    );
  • Zod schema defining input parameters for wave_get_usage: 'period' (enum current/previous, optional) and 'breakdown' (enum summary/daily/by_stream, optional).
    {
      period: z
        .enum(["current", "previous"])
        .optional()
        .describe("Billing period to query (default: current)"),
      breakdown: z
        .enum(["summary", "daily", "by_stream"])
        .optional()
        .describe("Level of usage detail (default: summary)"),
    },
  • The registerBillingTools function registers both wave_get_subscription and wave_get_usage tools on the MCP server via server.tool(). Called from src/server.ts line 23.
    export function registerBillingTools(server: McpServer): void {
      server.tool(
        "wave_get_subscription",
        "Get current subscription details including plan, billing cycle, and feature entitlements",
        {},
        async () => {
          const res = await waveFetch("/api/v1/billing/subscription");
          if (!res.ok) return errorContent(res.status, res.body);
    
          return textContent(res.body);
        },
      );
    
      server.tool(
        "wave_get_usage",
        "Get current billing period usage including streaming minutes, storage, and bandwidth consumption",
        {
          period: z
            .enum(["current", "previous"])
            .optional()
            .describe("Billing period to query (default: current)"),
          breakdown: z
            .enum(["summary", "daily", "by_stream"])
            .optional()
            .describe("Level of usage detail (default: summary)"),
        },
        async ({ period, breakdown }) => {
          const params = new URLSearchParams();
          if (period) params.set("period", period);
          if (breakdown) params.set("breakdown", breakdown);
    
          const query = params.toString();
          const path = `/api/v1/billing/usage${query ? `?${query}` : ""}`;
          const res = await waveFetch(path);
          if (!res.ok) return errorContent(res.status, res.body);
    
          return textContent(res.body);
        },
      );
    }
  • src/server.ts:23-24 (registration)
    The call site where registerBillingTools is invoked to register billing tools (including wave_get_usage) on the MCP server.
    registerBillingTools(server);
    registerProductionTools(server);
  • The waveFetch helper used by the handler to make authenticated API calls. Constructs URL using getBaseUrl() from auth.ts and includes auth headers.
    async function waveFetch(
      path: string,
      init?: RequestInit,
    ): Promise<{ ok: boolean; status: number; body: string }> {
      const url = `${getBaseUrl()}${path}`;
      const res = await fetch(url, {
        ...init,
        headers: {
          ...getAuthHeaders(),
          ...init?.headers,
        },
      });
      const body = await res.text();
      return { ok: res.ok, status: res.status, body };
    }
Behavior3/5

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

No annotations are present, so the description carries full responsibility. It correctly indicates a read-only operation (retrieves usage data) but does not disclose any behavioral traits such as authentication requirements, rate limits, or side effects. The description is adequate but minimal.

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 a single sentence that is concise, front-loaded with the action ('Get current billing period usage'), and free of fluff. Every word earns its place.

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

Completeness4/5

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

Given 2 optional parameters and no output schema, the description provides sufficient context about what data the tool returns (usage including streaming minutes, storage, bandwidth). It does not detail response format or pagination, but for a simple retrieval tool this is acceptable.

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?

Schema coverage is 100% with both parameters (period, breakdown) having enum descriptions. The description lists only the high-level metrics (streaming minutes, storage, bandwidth) but adds no meaning beyond the schema. Baseline score of 3 is appropriate when schema already documents parameters.

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 the tool retrieves current billing period usage, specifying three concrete metrics (streaming minutes, storage, bandwidth). This verb-resource combination uniquely distinguishes it from sibling tools like wave_get_subscription (subscription details) and wave_get_stream_metrics (stream-level metrics).

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

Usage Guidelines3/5

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

The description implies usage for billing period queries but provides no explicit guidance on when to use this tool vs. alternatives like wave_get_subscription or wave_get_stream_metrics. No when-not-to-use or prerequisite information is given.

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/wave-av/mcp-server'

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