Skip to main content
Glama
Linked-API
by Linked-API

get_api_usage

Retrieve usage statistics for the Linked API MCP server within a specified date range up to 30 days to monitor API consumption and track activity.

Instructions

Retrieve Linked API usage statistics. Date range must not exceed 30 days.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startYesStart date for the statistics period in ISO 8601 format (e.g., '2024-01-01T00:00:00Z')
endYesEnd date for the statistics period in ISO 8601 format (e.g., '2024-01-30T00:00:00Z')

Implementation Reference

  • The execute method implements the get_api_usage tool by calling the LinkedAPI's getApiUsage method with the provided date range arguments.
    public override async execute({
      linkedapi,
      args,
    }: {
      linkedapi: LinkedApi;
      args: TApiUsageParams;
      workflowTimeout: number;
      progressToken?: string | number;
    }): Promise<TMappedResponse<TApiUsageAction[]>> {
      return await linkedapi.getApiUsage(args);
    }
  • Defines the tool specification including name, description, and input schema for MCP validation.
    public override getTool(): Tool {
      return {
        name: this.name,
        description: 'Retrieve Linked API usage statistics. Date range must not exceed 30 days.',
        inputSchema: {
          type: 'object',
          properties: {
            start: {
              type: 'string',
              description:
                "Start date for the statistics period in ISO 8601 format (e.g., '2024-01-01T00:00:00Z')",
            },
            end: {
              type: 'string',
              description:
                "End date for the statistics period in ISO 8601 format (e.g., '2024-01-30T00:00:00Z')",
            },
          },
          required: ['start', 'end'],
        },
      };
    }
  • Zod schema for internal input validation of start and end dates.
    protected readonly schema = z.object({
      start: z.string(),
      end: z.string(),
    });
  • Instantiates the GetApiUsageTool and adds it to the list of available tools in LinkedApiTools.
    new GetApiUsageTool(progressCallback),
  • Imports the GetApiUsageTool class for use in tool registration.
    import { GetApiUsageTool } from './tools/get-api-usage-stats.js';
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 discloses the 30-day limit constraint, which is useful behavioral context. However, it doesn't mention whether this is a read-only operation, what permissions are needed, rate limits, error conditions, or the format of returned statistics. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 extremely concise with just two sentences that are front-loaded and waste-free. Every word earns its place by stating the purpose and a key constraint, making it easy to parse and understand quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (2 required parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and a key constraint but lacks details on behavioral aspects like permissions, rate limits, or return format. With no output schema, the description should ideally hint at what statistics are returned, but it doesn't, leaving some contextual gaps.

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 description coverage is 100%, with both parameters ('start' and 'end') fully documented in the schema. The description adds the constraint that the date range 'must not exceed 30 days', which provides additional semantic meaning beyond the schema's format specifications. This justifies a baseline score of 3, as the schema does the heavy lifting but the description adds some value.

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 verb 'Retrieve' and the resource 'Linked API usage statistics', making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'retrieve_performance' or 'retrieve_ssi' that might also retrieve statistics, leaving some ambiguity about what makes this tool unique.

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 provides implicit usage guidance by stating 'Date range must not exceed 30 days', which suggests when to use this tool (for API usage statistics within a limited timeframe). However, it doesn't explicitly mention when to use this versus alternatives like 'retrieve_performance' or provide any exclusion criteria, leaving the context somewhat implied rather than fully specified.

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/Linked-API/linkedapi-mcp'

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