check_quota
Verify rate limit quota availability for API calls to prevent rate limiting issues before making requests.
Instructions
Check if an agent has rate limit quota available before making an API call. Cost: $0.0005 USDC. Service: ratelord.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | ||
| api_name | Yes | ||
| calls_needed | No |
Implementation Reference
- src/index.ts:166-223 (handler)The codebase uses a dynamic registry approach where tools are not hardcoded but fetched from a remote JSON registry. The tool 'check_quota' (if present in the remote registry) would be executed via this generic `CallToolRequestSchema` handler which calls `callTool` to dispatch the request to the configured service endpoint.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; let registry: Registry; try { registry = await fetchRegistry(); } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ error: "Failed to fetch tool registry", detail: String(error) }), }, ], }; } const tool = registry.tools.find((t) => t.name === name); if (!tool) { return { content: [ { type: "text", text: JSON.stringify({ error: `Tool '${name}' not found`, available_tools: registry.tools.map((t) => t.name), }), }, ], }; } try { const result = await callTool(tool, args as Record<string, unknown>); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ error: "Tool call failed", tool: name, service: tool.service, detail: String(error), }), }, ], }; } });