Skip to main content
Glama

list_gists

Retrieve and manage your GitHub gists to view code snippets, notes, and files. Filter by update time and paginate results for organized access.

Instructions

List gists for the authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoOnly gists updated at or after this time are returned
per_pageNoResults per page (max 100)
pageNoPage number of the results

Implementation Reference

  • The main handler function that lists gists for the authenticated user by making a GitHub API request to /gists with optional query parameters.
    export async function listGists( github_pat: string, options: { since?: string; per_page?: number; page?: number; } = {} ): Promise<z.infer<typeof GistSchema>[]> { const url = new URL("https://api.github.com/gists"); if (options.since) url.searchParams.append("since", options.since); if (options.per_page) url.searchParams.append("per_page", options.per_page.toString()); if (options.page) url.searchParams.append("page", options.page.toString()); const response = await githubRequest(github_pat, url.toString()); return z.array(GistSchema).parse(response); }
  • Zod schema defining the input parameters for the list_gists tool (since, per_page, page).
    export const ListGistsSchema = z.object({ since: z.string().optional().describe("Only gists updated at or after this time are returned"), per_page: z.number().optional().describe("Results per page (max 100)"), page: z.number().optional().describe("Page number of the results"), });
  • src/index.ts:238-242 (registration)
    Tool registration in the listTools handler, defining name, description, and input schema.
    { name: "list_gists", description: "List gists for the authenticated user", inputSchema: zodToJsonSchema(gists.ListGistsSchema), },
  • src/index.ts:666-673 (registration)
    Dispatcher case in the callTool handler that parses arguments, calls the listGists function, and formats the response.
    case "list_gists": { const args = gists._ListGistsSchema.parse(params.arguments); const { github_pat, ...options } = args; const result = await gists.listGists(github_pat, options); 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