Skip to main content
Glama
Sunwood-ai-labs

GitHub Kanban MCP Server

update_issue

Update GitHub issues by modifying titles, descriptions, status, labels, or assignees. Automates task management through the GitHub Kanban MCP Server, streamlining issue tracking and collaboration.

Instructions

既存のissueを更新します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneesNo新しいアサイン
bodyNo新しい本文
emojiNoタイトルの先頭に付与する絵文字
issue_numberYesissue番号
labelsNo新しいラベル
pathNoGitリポジトリの絶対パス
stateNo新しい状態
titleNo新しいタイトル

Implementation Reference

  • Core handler function that executes the update_issue tool logic using GitHub CLI (gh) commands to edit issue title, body, labels, assignees, and state.
    export async function handleUpdateIssue(args: UpdateIssueArgs): Promise<ToolResponse> { const { owner, repo } = await getRepoInfo(args); // タイトルが更新される場合は絵文字を付与(指定がある場合) const titleFlag = args.title ? `--title "${args.emoji ? `${args.emoji} ${args.title}` : args.title}"` : ''; const labelsFlag = args.labels?.length ? `--add-label ${args.labels.join(',')}` : ''; const assigneesFlag = args.assignees?.length ? `--add-assignee ${args.assignees.join(',')}` : ''; const tempFile = 'update_body.md'; let bodyFlag = ''; try { // 状態の更新を処理 if (args.state) { const command = args.state === 'closed' ? 'close' : 'reopen'; await execAsync( `gh issue ${command} ${args.issue_number} --repo ${owner}/${repo}` ); } // その他の更新を処理 if (args.title || args.body || args.labels?.length || args.assignees?.length) { if (args.body) { const fullPath = await writeToTempFile(args.body, tempFile); bodyFlag = `--body-file "${fullPath}"`; } await execAsync( `gh issue edit ${args.issue_number} --repo ${owner}/${repo} ${titleFlag} ${bodyFlag} ${labelsFlag} ${assigneesFlag}` ); } const { stdout: issueData } = await execAsync( `gh issue view ${args.issue_number} --repo ${owner}/${repo} --json number,title,state,url` ); return { content: [ { type: 'text', text: issueData, }, ], }; } finally { if (args.body) { await removeTempFile(tempFile); } } }
  • Tool dispatcher switch case that validates inputs and delegates to the specific handleUpdateIssue function.
    case 'update_issue': { if (!args?.issue_number) { throw new McpError(ErrorCode.InvalidParams, 'Issue number is required'); } return await handleUpdateIssue({ path: args.path as string, issue_number: Number(args.issue_number), title: args?.title as string | undefined, emoji: args?.emoji as string | undefined, body: args?.body as string | undefined, state: args?.state as 'open' | 'closed' | undefined, labels: args?.labels as string[] | undefined, assignees: args?.assignees as string[] | undefined, }); }
  • src/server.ts:52-55 (registration)
    MCP server tool registration listing the 'update_issue' tool with its name, description, and input schema.
    name: 'update_issue', description: '既存のissueを更新します', inputSchema: updateIssueSchema, },
  • JSON schema defining the input structure and validation for the update_issue tool parameters.
    export const updateIssueSchema = { type: 'object', properties: { path: { type: 'string', description: 'Gitリポジトリの絶対パス', }, issue_number: { type: 'number', description: 'issue番号', }, title: { type: 'string', description: '新しいタイトル', }, emoji: { type: 'string', description: 'タイトルの先頭に付与する絵文字', }, body: { type: 'string', description: '新しい本文', }, state: { type: 'string', enum: ['open', 'closed'], description: '新しい状態', }, labels: { type: 'array', items: { type: 'string', }, description: '新しいラベル', }, assignees: { type: 'array', items: { type: 'string', }, description: '新しいアサイン', }, }, required: ['issue_number'], };
  • TypeScript interface defining the arguments for the update_issue handler.
    export interface UpdateIssueArgs { path: string; // Gitリポジトリの絶対パス issue_number: number; title?: string; emoji?: string; body?: string; state?: 'open' | 'closed'; labels?: string[]; assignees?: string[]; }

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/Sunwood-ai-labs/github-kanban-mcp-server'

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