Skip to main content
Glama

create_gist

Create and share code snippets or text files on GitHub as gists for collaboration or reference, with options for public or private visibility.

Instructions

Create a new gist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the gist
publicYesWhether the gist is public
filesYesFiles that make up this gist. The key is the filename.

Implementation Reference

  • Core handler function that executes the logic to create a GitHub gist via API POST request.
    export async function createGist(
      github_pat: string,
      description: string | undefined,
      isPublic: boolean,
      files: Record<string, { content: string }>
    ): Promise<z.infer<typeof GistSchema>> {
      const response = await githubRequest(
        github_pat,
        "https://api.github.com/gists",
        {
          method: "POST",
          body: {
            description,
            public: isPublic,
            files,
          },
        }
      );
      return GistSchema.parse(response);
    }
  • Input schema definition used for tool validation (public schema without PAT).
    export const CreateGistSchema = z.object({
      description: z.string().optional().describe("Description of the gist"),
      public: z.boolean().describe("Whether the gist is public"),
      files: z.record(
        z.object({
          content: z.string().describe("Content of the file"),
        })
      ).describe("Files that make up this gist. The key is the filename."),
    });
  • src/index.ts:234-237 (registration)
    Tool registration in the ListTools response, specifying name, description, and input schema.
      name: "create_gist",
      description: "Create a new gist",
      inputSchema: zodToJsonSchema(gists.CreateGistSchema),
    },
  • Dispatch handler in the main tool call switch statement that invokes the gists.createGist function.
    case "create_gist": {
      const args = gists._CreateGistSchema.parse(params.arguments);
      const { github_pat, description, public: isPublic, files } = args;
      const result = await gists.createGist(github_pat, description, isPublic, files);
      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?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create a new gist' implies a write/mutation operation, but it doesn't disclose authentication requirements, rate limits, whether the operation is idempotent, what happens on failure, or the response format. This is a significant gap for a mutation tool with zero annotation coverage.

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 extremely concise at just three words, front-loaded with the core action. There's zero waste or redundancy, making it efficient for quick scanning. Every word earns its place.

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?

For a mutation tool with no annotations, no output schema, and complex nested parameters (files object), the description is incomplete. It doesn't explain what a gist is, the GitHub context, authentication needs, or behavioral traits. The schema covers parameters well, but overall context is lacking for proper agent use.

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%, so the schema already documents all three parameters (description, public, files) thoroughly. The description adds no parameter semantics beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting, but no extra value is added.

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

Purpose3/5

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

The description 'Create a new gist' clearly states the action (create) and resource (gist), but it's vague about what a gist is in this context and doesn't distinguish from siblings like create_repository or create_issue. It's a basic statement of purpose without specificity.

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?

No guidance on when to use this tool versus alternatives is provided. There's no mention of prerequisites, when to choose this over similar tools like create_repository, or any context about gist creation versus other GitHub operations. The description offers no usage context.

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