get_rate_limit
Monitor GitHub API rate limits with ease using this tool, ensuring your operations stay within usage thresholds and avoid disruptions.
Instructions
Check the current rate limit status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/operations/rate_limit.ts:34-42 (handler)The core handler function that executes the 'get_rate_limit' tool by making a request to the GitHub Rate Limit API endpoint and parsing the response with the RateLimitSchema.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); }
- src/operations/rate_limit.ts:27-31 (schema)Input schemas for the get_rate_limit tool: base GetRateLimitSchema (empty object) and extended _GetRateLimitSchema that adds the required github_pat field.export const GetRateLimitSchema = z.object({}); export const _GetRateLimitSchema = GetRateLimitSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/operations/rate_limit.ts:12-24 (schema)Output validation schema (RateLimitSchema) for parsing the GitHub rate limit API response, composed of multiple RateLimitResourceSchema objects.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)Registration of the 'get_rate_limit' tool in the MCP server's tool list, providing name, description, and input schema reference.{ name: "get_rate_limit", description: "Check the current rate limit status", inputSchema: zodToJsonSchema(rate_limit.GetRateLimitSchema), },