Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

update-issue

Modify existing GitHub repository issues by updating titles, descriptions, assignees, milestones, labels, or status through the GitHub Enterprise MCP Server.

Instructions

Update an existing issue in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneesNo
bodyNo
issue_numberYes
labelsNo
milestoneNo
ownerYes
repoYes
stateNo
titleNo

Implementation Reference

  • The primary handler function for the 'update-issue' tool. It validates the input parameters using UpdateIssueSchema, calls the GitHub API to update the specified issue, and returns a formatted response with the updated issue details.
    export async function updateIssue(args: unknown): Promise<any> {
      const { owner, repo, issue_number, title, body, assignees, milestone, labels, state } = UpdateIssueSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().issues.update({
          owner,
          repo,
          issue_number,
          title,
          body,
          assignees,
          milestone,
          labels,
          state,
        });
    
        return {
          id: data.id,
          number: data.number,
          title: data.title,
          state: data.state,
          assignees: data.assignees?.map((assignee) => ({
            login: assignee.login,
            id: assignee.id,
          })),
          labels: data.labels?.map((label) => 
            typeof label === 'string' ? label : {
              name: label.name,
              color: label.color,
            }
          ),
          milestone: data.milestone ? {
            number: data.milestone.number,
            title: data.milestone.title,
          } : null,
          updated_at: data.updated_at,
          body: data.body,
          url: data.html_url,
        };
      }, 'Failed to update issue');
    }
  • Zod schema used for input validation in the updateIssue handler, extending OwnerRepoSchema with optional update fields.
    export const UpdateIssueSchema = OwnerRepoSchema.extend({
      issue_number: z.number().int().positive(),
      title: z.string().optional(),
      body: z.string().optional(),
      assignees: z.array(z.string()).optional(),
      milestone: z.number().optional(),
      labels: z.array(z.string()).optional(),
      state: z.enum(['open', 'closed']).optional(),
    });
  • src/server.ts:624-668 (registration)
    MCP tool registration including name, description, and input schema definition passed to server.setTools().
    {
      name: 'update-issue',
      description: 'Update an existing issue in a GitHub repository',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
          },
          repo: {
            type: 'string',
          },
          issue_number: {
            type: 'number',
          },
          title: {
            type: 'string',
          },
          body: {
            type: 'string',
          },
          assignees: {
            type: 'array',
            items: {
              type: 'string',
            },
          },
          milestone: {
            type: 'number',
          },
          labels: {
            type: 'array',
            items: {
              type: 'string',
            },
          },
          state: {
            type: 'string',
            enum: ['open', 'closed'],
          },
        },
        required: ['owner', 'repo', 'issue_number'],
        additionalProperties: false,
      },
    },
  • Dispatch case in the MCP request handler that routes 'update-issue' calls to the updateIssue function.
    case 'update-issue':
      result = await updateIssue(parsedArgs);
      break;
  • Shared GitHub API client utility (getGitHubApi) used by the handler to obtain the Octokit instance.
    import { Octokit } from '@octokit/rest';
    import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
    
    /**
     * GitHub API client wrapper
     */
    export class GitHubApi {
      private octokit: Octokit;
      private baseUrl?: string;
    
      /**
       * Create a new GitHub API client
       * @param token GitHub Personal Access Token
       * @param baseUrl Optional base URL for GitHub Enterprise
       */
      constructor(token: string, baseUrl?: string) {
        if (!token) {
          throw new McpError(
            ErrorCode.ConfigurationError,
            'GitHub Personal Access Token is required'
          );
        }
    
        this.baseUrl = baseUrl;
        this.octokit = new Octokit({
          auth: token,
          ...(baseUrl ? { baseUrl } : {}),
        });
      }
    
      /**
       * Get the Octokit instance
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. It states this is an update operation but doesn't mention permissions required, whether changes are reversible, rate limits, or what happens to unspecified fields. For a mutation tool with 9 parameters, this leaves significant behavioral 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 that gets straight to the point with no wasted words. It's appropriately sized for a basic tool description and front-loads the essential information.

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 complex mutation tool with 9 parameters, 0% schema coverage, no annotations, and no output schema, the description is severely incomplete. It doesn't address behavioral aspects, parameter meanings, usage context, or expected outcomes, leaving the agent with insufficient information to use the tool effectively.

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 but adds no parameter information beyond what's implied by 'update an existing issue.' It doesn't explain what parameters like 'assignees', 'milestone', or 'state' do, their formats, or which fields are required versus optional. This leaves most parameters semantically unclear.

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 ('Update') and resource ('existing issue in a GitHub repository'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential siblings like 'update-pull-request-branch' or 'update-repository' beyond the issue focus, which prevents 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 an existing issue), contrast with 'create-issue' for new issues, or specify scenarios where this is appropriate over other update tools in the sibling list.

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/piyushgIITian/github-enterprice-mcp'

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