list_issues
Retrieve issues from a GitHub Kanban board, with optional filtering by state (open, closed, all) and labels to streamline task management.
Instructions
カンバンボードのissue一覧を取得します
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Gitリポジトリの絶対パス | |
| state | No | issueの状態 | |
| labels | No | フィルタリングするラベル |
Implementation Reference
- src/handlers/issue-handlers.ts:24-41 (handler)The main handler function that executes the 'list_issues' tool logic. It retrieves repo info, constructs a gh CLI command with optional state/labels filters, and returns the JSON output.
export async function handleListIssues(args: IssueArgs): Promise<ToolResponse> { const { owner, repo } = await getRepoInfo(args); const stateFlag = args.state ? `--state ${args.state}` : ''; const labelsFlag = args.labels?.length ? `--label ${args.labels.join(',')}` : ''; const { stdout } = await execAsync( `gh issue list --repo ${owner}/${repo} ${stateFlag} ${labelsFlag} --json number,title,state,labels,assignees,createdAt,updatedAt` ); return { content: [ { type: 'text', text: stdout, }, ], }; } - src/schemas/issue-schemas.ts:1-22 (schema)JSON Schema for list_issues input validation. Defines optional path (string), state (enum: open/closed/all), and labels (array of strings) properties.
export const listIssuesSchema = { type: 'object', properties: { path: { type: 'string', description: 'Gitリポジトリの絶対パス', }, state: { type: 'string', enum: ['open', 'closed', 'all'], description: 'issueの状態', }, labels: { type: 'array', items: { type: 'string', }, description: 'フィルタリングするラベル', }, }, required: [], }; - src/server.ts:41-45 (registration)Registration of the 'list_issues' tool with the MCP server, including its description and inputSchema reference via ListToolsRequestSchema.
{ name: 'list_issues', description: 'カンバンボードのissue一覧を取得します', inputSchema: listIssuesSchema, }, - src/handlers/tool-handlers.ts:41-46 (registration)The tool dispatch case in handleToolRequest that routes 'list_issues' requests to handleListIssues, extracting path, state, and labels from arguments.
case 'list_issues': return await handleListIssues({ path: args.path as string, state: args?.state as 'open' | 'closed' | 'all', labels: args?.labels as string[], }); - src/types.ts:1-5 (helper)IssueArgs interface defining the TypeScript types used by the list_issues handler (path, state, labels).
export interface IssueArgs { path: string; // Gitリポジトリの絶対パス state?: 'open' | 'closed' | 'all'; labels?: string[]; }