Skip to main content
Glama

get_rate_limit

Check GitHub API rate limit status to monitor usage and prevent hitting request caps.

Instructions

Check the current rate limit status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that makes the GitHub API request to retrieve rate limit information and parses the response using the defined schema.
    export async function getRateLimit( github_pat: string ): Promise<z.infer<typeof RateLimitSchema>> { const response = await githubRequest( github_pat, "https://api.github.com/rate_limit" ); return RateLimitSchema.parse(response); }
  • Input schema definitions for the get_rate_limit tool, including the public schema and internal extended schema with github_pat.
    export const GetRateLimitSchema = z.object({}); export const _GetRateLimitSchema = GetRateLimitSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
  • Output schema definitions for parsing the GitHub rate limit API response.
    export const RateLimitResourceSchema = z.object({ limit: z.number(), used: z.number(), remaining: z.number(), reset: z.number(), }); export const RateLimitSchema = z.object({ resources: z.object({ core: RateLimitResourceSchema, search: RateLimitResourceSchema, graphql: RateLimitResourceSchema, integration_manifest: RateLimitResourceSchema, code_scanning_upload: RateLimitResourceSchema, actions_runner_registration: RateLimitResourceSchema, scim: RateLimitResourceSchema, dependency_snapshots: RateLimitResourceSchema, }), rate: RateLimitResourceSchema, });
  • src/index.ts:227-231 (registration)
    Tool registration in the MCP server's list of available tools.
    { name: "get_rate_limit", description: "Check the current rate limit status", inputSchema: zodToJsonSchema(rate_limit.GetRateLimitSchema), },
  • Dispatch handler in the main CallToolRequest handler that validates input and delegates to the rate_limit.getRateLimit function.
    case "get_rate_limit": { const args = rate_limit._GetRateLimitSchema.parse(params.arguments); const result = await rate_limit.getRateLimit(args.github_pat); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }

Latest Blog Posts

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/MissionSquad/mcp-github'

If you have feedback or need assistance with the MCP directory API, please join our Discord server