Skip to main content
Glama

Linked API MCP

by Linked-API
get-api-usage-stats.ts1.43 kB
import { Tool } from '@modelcontextprotocol/sdk/types.js'; import LinkedApi, { TApiUsageAction, TApiUsageParams, TMappedResponse } from 'linkedapi-node'; import z from 'zod'; import { LinkedApiTool } from '../utils/linked-api-tool.js'; export class GetApiUsageTool extends LinkedApiTool<TApiUsageParams, TApiUsageAction[]> { public readonly name = 'get_api_usage'; protected readonly schema = z.object({ start: z.string(), end: z.string(), }); public override async execute({ linkedapi, args, }: { linkedapi: LinkedApi; args: TApiUsageParams; workflowTimeout: number; progressToken?: string | number; }): Promise<TMappedResponse<TApiUsageAction[]>> { return await linkedapi.getApiUsage(args); } 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'], }, }; } }

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