Skip to main content
Glama

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';

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