Skip to content

Add get_parent method to issue_read#2726

Open
zwick wants to merge 1 commit into
mainfrom
zwick/issue-dependencies-mcp
Open

Add get_parent method to issue_read#2726
zwick wants to merge 1 commit into
mainfrom
zwick/issue-dependencies-mcp

Conversation

@zwick

@zwick zwick commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Add a get_parent method to the existing issue_read tool that reads an issue's parent — the upward counterpart to the existing get_sub_issues (children).

Why

issue_read could read an issue's children (get_sub_issues) but had no way to read its parent, even though the GitHub API exposes it. This fills that gap with a small, always-on method on a default tool.

Refs #2391, #950

What changed

  • issue_read → new get_parent method. Reads the GraphQL Issue.parent field and returns a null parent when the issue isn't a sub-issue.
  • Kept always-on (not feature-gated), mirroring get_sub_issues. The schema cost is one enum value plus a couple of doc lines.

MCP impact

  • Tool schema or behavior changed — issue_read gains a get_parent method; existing methods are unchanged.

Prompts tested (tool changes only)

Security / limits

  • Auth / permissions considered — read-only; requires repo scope like the rest of issue_read.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Updated (README regenerated for the new issue_read method)

Split out from the original combined PR. The flag-gated issue dependency tools (issue_dependency_read / issue_dependency_write) now live in #2751.

Copilot AI review requested due to automatic review settings June 17, 2026 20:31
@zwick zwick requested a review from a team as a code owner June 17, 2026 20:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new feature-flagged MCP tools to read and modify GitHub Issue dependency relationships (blocked-by / blocking) using GraphQL connections and the addBlockedBy / removeBlockedBy mutations, filling a gap not covered by existing issue relationship tools.

Changes:

  • Introduces issue_dependency_read (GraphQL Issue.blockedBy / Issue.blocking) with cursor pagination.
  • Introduces issue_dependency_write (GraphQL addBlockedBy / removeBlockedBy) resolving issue numbers to node IDs in a single aliased query.
  • Adds the issue_dependencies feature flag, tests, toolsnap snapshots, and regenerated docs sections.
Show a summary per file
File Description
pkg/github/tools.go Registers the new issue dependency tools in the overall tool inventory (feature-flag gated).
pkg/github/issue_dependencies.go Implements read/write tools and supporting GraphQL query/mutation helpers.
pkg/github/issue_dependencies_test.go Adds schema snapshot validation and behavior tests for the new tools.
pkg/github/feature_flags.go Introduces the issue_dependencies flag and wires it into feature-flag sets.
pkg/github/toolsnaps/issue_dependency_read_ff_issue_dependencies.snap Adds the flag-gated schema snapshot for the read tool.
pkg/github/toolsnaps/issue_dependency_write_ff_issue_dependencies.snap Adds the flag-gated schema snapshot for the write tool.
docs/insiders-features.md Documents the new issue_dependencies flag/tools in insiders features (generated section).
docs/feature-flags.md Documents the new issue_dependencies flag/tools in feature flags (generated section).

Copilot's findings

  • Files reviewed: 8/8 changed files
  • Comments generated: 1

Comment thread pkg/github/feature_flags.go
@zwick zwick marked this pull request as draft June 17, 2026 20:39
@zwick zwick self-assigned this Jun 17, 2026
@zwick zwick changed the title Add issue dependency read/write MCP tools Add issue dependency tools and issue_read get_parent Jun 17, 2026
@zwick zwick marked this pull request as ready for review June 18, 2026 19:43
Add an upward parent read to issue_read, the counterpart to the existing
downward get_sub_issues. Uses the GraphQL Issue.parent field and returns a
null parent when the issue is not a sub-issue. Kept always-on (not feature
gated) to mirror get_sub_issues; the dependency tools remain flag-gated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zwick zwick force-pushed the zwick/issue-dependencies-mcp branch from 409844e to 004248c Compare June 22, 2026 16:11
@zwick zwick changed the title Add issue dependency tools and issue_read get_parent Add get_parent method to issue_read Jun 22, 2026
@zwick zwick marked this pull request as draft June 22, 2026 16:13
@zwick zwick marked this pull request as ready for review June 22, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants