feat(tools): add GraphQL query and schema introspection tools#80
feat(tools): add GraphQL query and schema introspection tools#80mcao2 wants to merge 5 commits intonetboxlabs:mainfrom
Conversation
|
Hey @mcao2, thanks for this PR, and genuinely sorry for how long it sat without a response. We’ve just landed a CONTRIBUTING.md that states our scope more clearly - GraphQL and schema introspection are deliberately out of scope for this OSS server. The aim is to keep it simple, read-only over REST, and easy to fork. I appreciate that scope hadn’t been communicated before you started, and I’m sorry we didn’t give you a clear signal earlier. So we won’t be merging this one. That said, the branch is a solid starting point if you want to run this capability against your own NetBox, forking under Apache 2.0 is first-class for exactly this kind of extension, and the code you’ve written is a clean basis. If you publish the fork, a discussion thread would be a welcome place to share it. Thanks again for the patience and the care you put into this. |
Complex queries against NetBox currently require multiple sequential tool calls — fetching
a device, then its interfaces, then their IP addresses means 3+ round-trips, each
returning fully-expanded nested objects that consume significant context. NetBox's GraphQL
API (
/graphql/) exposes the same data with precise field selection and cross-objectjoins in a single request, but it's been inaccessible from the MCP server.
This adds three tools built around a new
graphql()method onNetBoxRestClient:netbox_graphql_queryexecutes raw GraphQL queries, whilenetbox_graphql_schema_searchand
netbox_graphql_type_detailsgive LLMs a way to discover the schema before writingqueries — the same discovery-then-query pattern used by Cloudflare's GraphQL MCP server.