Commit 2fc8a6d
authored
feat(tools): add two new GraphQL tools (#242)
* chore(deps): combine dependabot dependency updates
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.
* feat(tools): add get_pr_linked_issues and get_pr_status_checks
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.
* refactor(tools): raise ToolError on failure, add ToolAnnotations, remove 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)
* refactor(tools): apply ToolAnnotations directly to methods via decorators
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.
* fix(quality): resolve duplicate heading and reduce cyclomatic complexity
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.
* refactor(tools): split _derive_overall into focused boolean helpers
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.
* feat(tools): add @_write annotations to all write-operation tools
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.
* fix(annotation): add correct hints to mr merge1 parent 7a95ec6 commit 2fc8a6d
10 files changed
Lines changed: 396 additions & 309 deletions
File tree
- src/mcp_github
- skills/ip-lookup
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | | - | |
| 113 | + | |
111 | 114 | | |
112 | | - | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
116 | | - | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
119 | 121 | | |
120 | | - | |
| 122 | + | |
121 | 123 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 124 | + | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 106 | + | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
0 commit comments