feat: add labels support to create_pull_request tool
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- go
- Domínio
- api, developer-experience, tooling
Direção de pesquisa
Comece revisando o PR #2413 e o CreatePullRequest InputSchema, a chamada AddLabelsToIssue, os testes e as alterações do pr-write MCP App mencionadas na issue. Execute go test ./... e golangci-lint run --new-from-rev=HEAD; considera-se concluído quando os labels opcionais funcionarem, as falhas de label informarem claramente que o PR foi criado e as ferramentas documentadas estiverem atualizadas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the feature or problem you'd like to solve
The create_pull_request tool currently does not support adding labels during PR creation. Users who want to label PRs at creation time must make a separate add_label tool call after creating the PR, which adds friction in agentic workflows where a PR should be created with appropriate labels in a single step.
This is especially common in real-world usage — developers naturally say "create a PR and label it as bug" rather than thinking of it as two separate operations.
Proposed solution
Add an optional labels parameter (string array) to the create_pull_request tool. Since the GitHub REST API (POST /repos/{owner}/{repo}/pulls) does not natively support labels, the implementation uses a two-step approach:
- Create the PR via the existing pulls endpoint
- Apply labels via
POST /repos/{owner}/{repo}/issues/{issue_number}/labels
If label application fails after PR creation, the error clearly indicates the PR was created successfully but labels could not be applied, so no work is silently lost.
Benefits:
- Reduces tool calls needed for a common workflow (2 → 1)
- Aligns with how developers naturally think about PR creation
- Fully backwards-compatible — the parameter is optional
- Consistent with
issue_writewhich already supports labels at creation time
Example prompts or workflows (for tools/toolsets only)
-
"Create a pull request from my feature branch to main and label it as
bugandpriority:high" — Single-step PR creation with classification labels, common in triage workflows. -
"Open a PR for this hotfix, mark it as draft, and add the
urgentlabel" — Combines draft mode with labeling for time-sensitive fixes. -
"Create a PR titled 'Add user auth' from
feat/authtodevelopwith labelsenhancementandsecurity" — Full PR creation with multiple labels in one natural request. -
"Submit a pull request for my changes and tag it as
documentation" — Simple single-label use case that feels natural to say but currently requires two tool calls. -
"Create PRs for each of my feature branches and label them with their respective area labels" — Batch automation scenario where reducing tool calls per PR matters.
Additional context
I have a working implementation in PR #2413 that includes:
- Backend:
labelsarray property inCreatePullRequestInputSchema +AddLabelsToIssuepost-creation call - Tests: 2 new test cases (success with labels, label failure after PR creation)
- UI: Labels input field in the
pr-writeMCP App - Docs: Updated toolsnap + auto-generated README via
script/generate-docs
All tests pass (go test ./...) and lint is clean (golangci-lint run --new-from-rev=HEAD → 0 issues).
- Linguagem predominante
- Go
- Estrelas
- 33.3k
- Forks
- 5.1k
- Merge médio
- 1d 1h
- PRs com merge (30d)
- 19
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/github-mcp-server
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
github/github-mcp-server#3235 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
github/github-mcp-server#3042 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/github-mcp-server#3032 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
github/github-mcp-server#2803 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
github/github-mcp-server#2740 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de github/github-mcp-server
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
bug needs-acceptance wg/developer-experience-ecosystem
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
vllm-project/semantic-router#4480 ·
Mantenedores costumam responder em até 1 dia
-
area/docs kind/documentation priority/backlog triage/accepted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
lexfrei/cloudflare-tunnel-gateway-controller#943 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
keyxmakerx/Chronicle#967 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
DaoCloud/DaoCloud-docs#7446 ·
Mantenedores costumam responder em até 1 dia