feat(tools): add two new GraphQL tools#242
Merged
Merged
Conversation
Batch update 5 dependencies from open dependabot PRs (#234-#237, #239): - authlib 1.7.0 -> 1.7.1 (PR #239) - cryptography 47.0.0 -> 48.0.0 (PR #234) - jsonschema-path 0.4.5 -> 0.4.6 (PR #237) - pydantic-settings 2.14.0 -> 2.14.1 (PR #235) - uv 0.11.12 -> 0.11.13 (PR #236) Note: pydantic-core (PR #238) excluded - bumping it independently conflicts with pydantic==2.13.3 which pins pydantic-core==2.46.3 exactly.
Two new GraphQL-backed tools that close genuine agent blind spots: - get_pr_linked_issues: queries closingIssuesReferences to return the authoritative list of issues that auto-close on merge. More reliable than text-parsing "Closes #N" keywords from the PR body, and picks up issues linked via the GitHub UI. - get_pr_status_checks: queries check suites and legacy commit status from the PR HEAD commit. Derives an overall "passing/failing/pending/ unknown" state so agents can make a merge decision without asking the user whether CI is green. Both auto-register as MCP tools via the existing inspect.getmembers() mechanism. Also fix pre-existing ruff formatting issues in auth.py, tests/__init__.py, and tests/test_auth.py.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 43 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Dependency ReviewThe following issues were found:
License Issuesrequirements.txt
OpenSSF Scorecard
Scanned Files
|
…ove IP tools
- Replace all return {"status": "error"} patterns with raise ToolError so
agents see failures as errors rather than successful results with error
payloads; merge_pr preserves the GitHub API message before raising
- Add ToolAnnotations to the registration layer: readOnlyHint=True on all
read-only tools so Claude skips confirmation prompts; destructiveHint=True
on merge_pr
- Remove get_ipv4_info and get_ipv6_info (IPIntegration, ip_integration.py,
ip-lookup skill, IPInfoError) - no genuine value in a GitHub-focused MCP
- Remove traceback import from github_integration (now unused)
…tors Replace the centralised _TOOL_ANNOTATIONS lookup dict in issues_pr_analyser.py with _read_only/_destructive decorator helpers in github_integration.py that stamp a _mcp_annotations attribute directly on each method.
Rename duplicate '### Features' heading in README to '### Tool Categories'. Extract status-set literals in _derive_overall to module-level frozensets and replace comprehension conditionals with set-difference, reducing cyclomatic complexity from 13 to 7.
Replace module-level frozenset constants with _has_failing_checks and _has_pending_checks private methods, restoring inline local sets and reducing _derive_overall cyclomatic complexity from 10 to 6.
Eleven public methods were registered without ToolAnnotations, leaving MCP clients unable to classify them as read/write. Adds a _write() decorator (readOnlyHint=False) and applies it to add_pr_comments, add_inline_pr_comment, update_pr_description, create_pr, create_issue, update_pr_branch, update_issue, update_reviews, update_assignees, create_tag, and create_release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two new GraphQL tools, plus a handful of improvements made along the way.
New tools
get_pr_linked_issues- returns issues that will auto-close when the PR merges, viaclosingIssuesReferenceson the GraphQLPullRequesttype. Parsing "Closes #N" from the body misses issues linked through the GitHub UI and cross-repo references; this is the authoritative source.get_pr_status_checks- returns check run conclusions and legacy commit status contexts for the PR's HEAD commit, plus anoverallfield (passing/failing/pending/unknown).get_pr_contentonly exposesmergeable, which reflects git conflict state, not CI.Other changes
ToolErrorinstead of returning{"status": "error", ...}dicts. MCP clients get a proper error response rather than a success response with an error payload.ToolAnnotations(readOnlyHint,destructiveHint) are now applied via@_read_only/@_destructivedecorators directly on the methods ingithub_integration.py, rather than a separate name-to-annotation lookup table inissues_pr_analyser.py._derive_overall(cyclomatic complexity 13) split into_has_failing_checksand_has_pending_checkshelpers (complexity 5 and 4 respectively).IPInfoErrorexception class along with the IP tools removed in a prior commit.### Featuresheading in README.Testing