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
| Name | Required | Description | Default |
|---|---|---|---|
| start | Yes | Start date for the statistics period in ISO 8601 format (e.g., '2024-01-01T00:00:00Z') | |
| end | Yes | End date for the statistics period in ISO 8601 format (e.g., '2024-01-30T00:00:00Z') |
Implementation Reference
- src/tools/get-api-usage-stats.ts:14-24 (handler)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(), }); - src/linked-api-tools.ts:65-65 (registration)Instantiates the GetApiUsageTool and adds it to the list of available tools in LinkedApiTools.
new GetApiUsageTool(progressCallback), - src/linked-api-tools.ts:8-8 (registration)Imports the GetApiUsageTool class for use in tool registration.
import { GetApiUsageTool } from './tools/get-api-usage-stats.js';