Skip to main content
Glama

get_api_usage_stats

Retrieve detailed Linked API usage statistics for a specified period in ISO 8601 format to monitor and analyze usage patterns effectively.

Instructions

Retrieve Linked API usage statistics

Input Schema

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

Implementation Reference

  • The execute method in GetApiUsageTool class that handles the tool execution by calling linkedapi.getApiUsage(args).
    public override async execute({ linkedapi, args, }: { linkedapi: LinkedApi; args: TApiUsageParams; workflowTimeout: number; progressToken?: string | number; }): Promise<TMappedResponse<TApiUsageAction[]>> { return await linkedapi.getApiUsage(args); }
  • Zod schema for input validation of start and end dates.
    protected readonly schema = z.object({ start: z.string(), end: z.string(), });
  • MCP Tool definition including name 'get_api_usage', description, and inputSchema.
    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'], }, }; }
  • Registration of GetApiUsageTool instance in the LinkedApiTools.tools array.
    new ExecuteCustomWorkflowTool(progressCallback), new GetWorkflowResultTool(progressCallback), new GetApiUsageTool(progressCallback), ];
  • MCP server method that exposes all tools including get_api_usage by calling getTool() on each.
    public getTools(): Tool[] { return this.tools.tools.map((tool) => tool.getTool()); }

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