feat: Add unraid_api tool for schema introspection and raw queries#8
feat: Add unraid_api tool for schema introspection and raw queries#8nkissick-del wants to merge 1 commit intojmagar:mainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="unraid_mcp/tools/api.py">
<violation number="1" location="unraid_mcp/tools/api.py:205">
P2: Regex-based mutation detection blocks valid read-only queries when the word “mutation” appears as an identifier (operation name, field, alias, argument), causing false positives and making the safety check fragile.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| # Block mutations | ||
| stripped = _strip_comments(graphql_query) | ||
| if re.search(r"\bmutation\b", stripped, re.IGNORECASE): |
There was a problem hiding this comment.
P2: Regex-based mutation detection blocks valid read-only queries when the word “mutation” appears as an identifier (operation name, field, alias, argument), causing false positives and making the safety check fragile.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At unraid_mcp/tools/api.py, line 205:
<comment>Regex-based mutation detection blocks valid read-only queries when the word “mutation” appears as an identifier (operation name, field, alias, argument), causing false positives and making the safety check fragile.</comment>
<file context>
@@ -0,0 +1,225 @@
+
+ # Block mutations
+ stripped = _strip_comments(graphql_query)
+ if re.search(r"\bmutation\b", stripped, re.IGNORECASE):
+ raise ToolError(
+ "Mutations are not allowed through this tool. "
</file context>
Overview
Adds a new advanced capability for the MCP server: Direct API Introspection.
Context
See the schema directly to construct custom queries when pre-built tools are insufficient.
New Tools
mutationoperations to strictly enforce read-only access.Verification
Summary by cubic
Adds API tools to explore the Unraid GraphQL schema and run read-only queries. Enables advanced querying while blocking write operations.
Written for commit 4713e1e. Summary will update on new commits.