get_api_usage
Get detailed API usage statistics for your LinkedIn account. Specify a start and end date (ISO 8601) to view usage within a 30-day maximum period.
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 that calls linkedapi.getApiUsage(args) to perform the tool's logic.
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 defining input parameters: 'start' and 'end' (both ISO 8601 strings).
protected readonly schema = z.object({ start: z.string(), end: z.string(), }); - src/linked-api-tools.ts:77-78 (registration)Registration of GetApiUsageTool in the LinkedApiTools constructor (line 77).
new GetApiUsageTool(progressCallback), ]; - getTool() method returning the Tool definition with input schema (name, description, start/end params).
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'], }, }; - src/utils/linked-api-tool.ts:8-34 (helper)Abstract base class LinkedApiTool that GetApiUsageTool extends.
export abstract class LinkedApiTool<TParams, TResult> { public abstract readonly name: string; protected abstract readonly schema: z.ZodSchema; protected readonly progressCallback: (progress: LinkedApiProgressNotification) => void; constructor(progressCallback: (progress: LinkedApiProgressNotification) => void) { this.progressCallback = progressCallback; } public abstract getTool(): Tool; public validate(args: unknown): TParams { return this.schema.parse(args) as TParams; } public abstract execute({ linkedapi, args, workflowTimeout, progressToken, }: { linkedapi: LinkedApi; args: TParams; workflowTimeout: number; progressToken?: string | number; }): Promise<TMappedResponse<TResult>>; }