Skip to main content
Glama

delete_issue

Remove an issue from a GitHub repository by specifying the owner, repo, and issue number using GraphQL API. Simplify issue cleanup and repository management.

Instructions

Delete an issue from a GitHub repository using GraphQL API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_numberYes
ownerYes
repoYes

Implementation Reference

  • The main handler function that implements the delete_issue tool logic: fetches issue node_id then deletes via GitHub GraphQL API.
    export async function deleteIssue(owner: string, repo: string, issue_number: number) {
      // Bước 1: Lấy node_id (GraphQL ID) của issue
      const issue = await getIssue(owner, repo, issue_number) as { node_id: string };
    
      if (!issue || !issue.node_id) {
        throw new Error(`Issue #${issue_number} not found or cannot be accessed`);
      }
    
      // Bước 2: Sử dụng GraphQL API để xóa issue
      const mutation = `
        mutation DeleteIssue($issueId: ID!) {
          deleteIssue(input: { issueId: $issueId }) {
            clientMutationId
            repository {
              id
              name
            }
          }
        }
      `;
    
      const variables = {
        issueId: issue.node_id
      };
    
      const result = await graphqlRequest(mutation, variables);
    
      return {
        success: true,
        issue_number: issue_number,
        repository: `${owner}/${repo}`,
        ...result.data.deleteIssue
      };
    }
  • Zod schema defining the input parameters for the delete_issue tool.
    export const DeleteIssueSchema = z.object({
      owner: z.string(),
      repo: z.string(),
      issue_number: z.number(),
    });
  • index.ts:210-213 (registration)
    Tool registration in the list of tools returned by ListToolsRequestHandler.
    {
      name: "delete_issue",
      description: "Delete an issue from a GitHub repository using GraphQL API",
      inputSchema: zodToJsonSchema(issues.DeleteIssueSchema),
  • Dispatcher case in the main CallToolRequestHandler that parses arguments and calls the deleteIssue function.
    case "delete_issue": {
      const args = issues.DeleteIssueSchema.parse(request.params.arguments);
      const result = await issues.deleteIssue(args.owner, args.repo, args.issue_number);
      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 the full burden of behavioral disclosure. It states the action is a deletion using GraphQL API, implying a destructive, irreversible operation, but lacks details on permissions required, rate limits, error handling, or what happens upon success (e.g., confirmation). This is insufficient 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 a single, efficient sentence that front-loads the core action ('Delete an issue') without unnecessary words. Every part earns its place by specifying the resource and API type, making it highly concise and well-structured for quick understanding.

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 the tool's complexity (a destructive mutation with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions or outcomes, parameter details, or usage context, leaving significant gaps for an AI agent to invoke it correctly.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate by explaining parameters. It adds no information about 'owner', 'repo', or 'issue_number' beyond what the schema's property names imply. For example, it doesn't clarify that 'owner' is a GitHub username/organization or that 'issue_number' is an integer. This leaves parameters poorly documented.

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 clearly states the action ('Delete') and resource ('an issue from a GitHub repository'), making the purpose immediately understandable. It distinguishes from siblings like 'update_issue' or 'get_issue' by specifying deletion. However, it doesn't explicitly differentiate from 'delete_card' or other deletion tools, keeping it from a perfect score.

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 prerequisites (e.g., needing admin permissions), when not to use it (e.g., for archiving instead), or direct alternatives among siblings like 'update_issue' for closing issues. Without such context, usage is unclear.

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

Related 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/tuanle96/mcp-github'

If you have feedback or need assistance with the MCP directory API, please join our Discord server