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) }],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states it lists gists 'for the authenticated user,' implying authentication is required, but doesn't disclose other behaviors like pagination (implied by parameters), rate limits, error handling, or output format. For a list operation with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose, making it easy to parse quickly. Every word earns its place by specifying the action, resource, and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a list tool with pagination parameters. It lacks details on authentication needs, rate limits, return format (e.g., list of gist objects), or error cases. The high schema coverage helps with inputs, but overall context is insufficient for safe agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for 'since' (time filter), 'per_page' (pagination limit), and 'page' (pagination offset). The description adds no parameter-specific semantics beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List gists for the authenticated user' clearly states the verb ('List') and resource ('gists'), with the scope 'for the authenticated user' distinguishing it from potential public listing tools. However, it doesn't explicitly differentiate from sibling tools like 'get_gist' (which retrieves a specific gist), though the 'list' vs 'get' naming helps.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_gist' (for single gists) or 'search_code' (which might find gists), nor does it specify prerequisites (e.g., authentication requirements) or exclusions (e.g., not for public gists).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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