Skip to main content
Glama

get_usage

View your current monthly image generation count and plan limits to monitor usage of the AI design API.

Instructions

Check current usage statistics including images generated this month and plan limits

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The registerGetUsageTool function registers the 'get_usage' tool on the MCP server. The handler calls client.getUsage() and returns formatted usage statistics (plan, images used, images limit, period). Catches errors and returns an error message in the response.
    export function registerGetUsageTool(
      server: McpServer,
      client: RendrKitClient,
    ): void {
      server.registerTool(
        "get_usage",
        {
          description:
            "Check current usage statistics including images generated this month and plan limits",
        },
        async () => {
          try {
            const usage = await client.getUsage();
    
            return {
              content: [
                {
                  type: "text" as const,
                  text: [
                    `Usage Statistics`,
                    ``,
                    `Plan: ${usage.plan}`,
                    `Images Used: ${usage.imagesUsed} / ${usage.imagesLimit}`,
                    `Period: ${usage.periodStart} to ${usage.periodEnd}`,
                  ].join("\n"),
                },
              ],
            };
          } catch (error) {
            const message =
              error instanceof Error ? error.message : String(error);
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Failed to get usage stats: ${message}`,
                },
              ],
              isError: true,
            };
          }
        },
      );
    }
  • The UsageStats interface defines the response shape of the getUsage API call, including plan, imagesUsed, imagesLimit, periodStart, and periodEnd.
    export interface UsageStats {
      plan: string;
      imagesUsed: number;
      imagesLimit: number;
      periodStart: string;
      periodEnd: string;
    }
  • src/server.ts:6-28 (registration)
    The tool is imported from './tools/get-usage.js' and registered via registerGetUsageTool(server, client) line 21 inside the createServer function.
    import { registerGetUsageTool } from "./tools/get-usage.js";
    import { registerListTemplatesTool } from "./tools/list-templates.js";
    import { registerUploadImageTool } from "./tools/upload-image.js";
    import { registerBatchRenderTool } from "./tools/batch-render.js";
    import { registerCloneTemplateTool } from "./tools/clone-template.js";
    
    export function createServer(client: RendrKitClient): McpServer {
      const server = new McpServer({
        name: "rendrkit",
        version: "0.3.0",
      });
    
      registerGenerateImageTool(server, client);
      registerGetImageTool(server, client);
      registerListBrandKitsTool(server, client);
      registerGetUsageTool(server, client);
      registerListTemplatesTool(server, client);
      registerUploadImageTool(server, client);
      registerBatchRenderTool(server, client);
      registerCloneTemplateTool(server, client);
    
      return server;
    }
  • The getUsage method on RendrKitClient makes a GET request to /api/v1/usage and returns a UsageStats object.
    async getUsage(): Promise<UsageStats> {
      return this.request<UsageStats>("GET", "/api/v1/usage");
    }
Behavior3/5

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

No annotations are provided, so the description bears full burden. It states 'check' usage, implying a read-only operation with no side effects. While sufficient, it could mention authentication needs or rate limits, but for a simple get tool this is adequate.

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?

A single 13-word sentence that is front-loaded and contains no unnecessary words. Every part adds value.

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 the tool's low complexity (no parameters, no output schema), the description covers the essential information. It could optionally describe the return format, but it is not necessary for this simple stats check.

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

Parameters4/5

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

The input schema has zero parameters with 100% schema description coverage. Per guidelines, 0 parameters gets a baseline of 4. Description adds no parameter semantics, but none are needed.

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 checks current usage statistics, specifically images generated this month and plan limits. It is distinct from siblings which handle rendering, generation, cloning, and template listings.

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 use for checking usage but does not explicitly contrast with siblings or provide when-not-to-use guidance. Given the tool's simplicity, no alternatives exist among siblings for this function, so the lack of explicit guidance is acceptable.

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/vbiff/rendr-kit'

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