Add PULL_REQUEST_TEMPLATE.md guidance to create_pull_request tool description#1077
Add PULL_REQUEST_TEMPLATE.md guidance to create_pull_request tool description#1077
Conversation
…cription Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the create_pull_request tool description to guide LLMs in using repository pull request templates for consistent PR descriptions. The change adds instruction to reference PULL_REQUEST_TEMPLATE.md files when creating pull requests, improving consistency with repository conventions.
- Modified the tool description to include guidance about referencing pull request templates
- Updated the corresponding tool snapshot to reflect the enhanced description
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/github/pullrequests.go | Enhanced tool description to include guidance about using PULL_REQUEST_TEMPLATE.md files |
| pkg/github/toolsnaps/create_pull_request.snap | Updated tool snapshot to match the new enhanced description |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) { | ||
| return mcp.NewTool("create_pull_request", | ||
| mcp.WithDescription(t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository.")), | ||
| mcp.WithDescription(t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository. If there is a PULL_REQUEST_TEMPLATE.md file in the repository, consider using it as a reference for the pull request description to follow repository conventions.")), |
There was a problem hiding this comment.
There's a typo in the PR description - 'existsis' should be 'exists'. However, this typo appears in the PR metadata description, not in the actual code change, which correctly uses 'there is'.
|
It is implemented here #1442 with server instructions, closing |
Summary
This PR enhances the
create_pull_requesttool description to instruct LLMs to use the repository'sPULL_REQUEST_TEMPLATE.mdfile as a reference when creating pull request descriptions, ensuring consistency with repository conventions.Problem
Currently, agents using the GitHub MCP server create pull requests without considering the pull request template that may exist in the repository. This leads to inconsistent PR descriptions that don't follow the established repository guidelines and UI flow that GitHub provides.
Solution
Updated the tool description for the
create_pull_requesttool to include guidance about referencingPULL_REQUEST_TEMPLATE.mdfiles:Before:
After:
Changes Made
pkg/github/pullrequests.gofor theCreatePullRequestfunctionpkg/github/__toolsnaps__/create_pull_request.snapTesting
This change is minimal and focused, providing better guidance to LLMs while maintaining full backward compatibility with existing implementations.
Closes #[issue_number]
Additional instructions:
Fixes #1076
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.