agentic_pr_create
Automatically create GitHub pull requests with AI-generated descriptions by providing an issue number. This tool analyzes issues and generates comprehensive PR content to streamline development workflows.
Instructions
PRAgent実行 - PR自動作成・説明文AI生成
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch_name | No | ブランチ名(オプション) | |
| issue_number | Yes | GitHub Issue番号 |
Implementation Reference
- server.ts:393-429 (handler)The handler function that implements the core logic of 'agentic_pr_create' by triggering a GitHub Actions workflow ('agentic-system.yml' with agent=pr) to automatically create a PR linked to the specified issue.private async handlePRCreate(args: { issue_number: number; branch_name?: string; }) { try { const branchParam = args.branch_name ? ` -f branch="${args.branch_name}"` : ''; await execAsync( `gh workflow run agentic-system.yml -f agent=pr -f issue_number=${args.issue_number}${branchParam}`, { cwd: process.env.GITHUB_REPOSITORY_PATH || process.cwd() } ); return { content: [ { type: 'text', text: `## 🔀 PRAgent起動 **Issue**: #${args.issue_number} ${args.branch_name ? `**Branch**: ${args.branch_name}` : '**Branch**: feature/issue-${args.issue_number}'} ✅ PR作成ワークフローを起動しました 作成されたPRは Issue #${args.issue_number} にリンクされます` } ] }; } catch (error) { return { content: [ { type: 'text', text: `❌ エラー: ${error instanceof Error ? error.message : 'Unknown error'}` } ] }; } }
- server.ts:111-124 (schema)Input schema defining the parameters for the 'agentic_pr_create' tool: required issue_number and optional branch_name.inputSchema: { type: 'object', properties: { issue_number: { type: 'number', description: 'GitHub Issue番号' }, branch_name: { type: 'string', description: 'ブランチ名(オプション)' } }, required: ['issue_number'] }
- server.ts:108-125 (registration)Tool definition and registration in the TOOLS array, returned by listTools handler for tool discovery.{ name: 'agentic_pr_create', description: 'PRAgent実行 - PR自動作成・説明文AI生成', inputSchema: { type: 'object', properties: { issue_number: { type: 'number', description: 'GitHub Issue番号' }, branch_name: { type: 'string', description: 'ブランチ名(オプション)' } }, required: ['issue_number'] } },
- server.ts:235-236 (registration)Dispatch case in the CallToolRequest handler switch statement that routes calls to the specific handler.case 'agentic_pr_create': return await this.handlePRCreate(args as any);