get_gist
Retrieve a specific GitHub gist by its ID to access code snippets, notes, or shared content stored on GitHub's gist platform.
Instructions
Get a specific gist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gist_id | Yes | The ID of the gist |
Implementation Reference
- src/operations/gists.ts:112-121 (handler)The main handler function that fetches a specific GitHub gist by ID using the GitHub API and parses the response with GistSchema.export async function getGist( github_pat: string, gist_id: string ): Promise<z.infer<typeof GistSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/gists/${gist_id}` ); return GistSchema.parse(response); }
- src/operations/gists.ts:64-66 (schema)Input schema for the get_gist tool, defining the required gist_id parameter.export const GetGistSchema = z.object({ gist_id: z.string().describe("The ID of the gist"), });
- src/index.ts:244-247 (registration)Tool registration in the list of tools provided to the MCP server, including name, description, and input schema.name: "get_gist", description: "Get a specific gist", inputSchema: zodToJsonSchema(gists.GetGistSchema), },
- src/index.ts:675-682 (registration)Dispatch handler in the switch statement that parses arguments, calls the getGist function, and formats the response for MCP.case "get_gist": { const args = gists._GetGistSchema.parse(params.arguments); const { github_pat, gist_id } = args; const result = await gists.getGist(github_pat, gist_id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }