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
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | End date for the statistics period in ISO 8601 format (e.g., '2024-01-31T23:59:59Z') | |
| start | Yes | Start date for the statistics period in ISO 8601 format (e.g., '2024-01-01T00:00:00Z') |
Implementation Reference
- src/tools/get-api-usage-stats.ts:14-24 (handler)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'], }, }; }
- src/linked-api-tools.ts:61-64 (registration)Registration of GetApiUsageTool instance in the LinkedApiTools.tools array.new ExecuteCustomWorkflowTool(progressCallback), new GetWorkflowResultTool(progressCallback), new GetApiUsageTool(progressCallback), ];
- src/linked-api-server.ts:22-24 (registration)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()); }