Query Graphql
query_graphqlRun read-only GraphQL queries against Infrahub to traverse relationships, aggregate data, or read fields missing from typed tools; mutations must use mutate_graphql.
Instructions
Execute a read-only GraphQL query against Infrahub — use for reads only, never mutations.
Mutations are rejected at the AST level: use mutate_graphql instead
(available when write mode is enabled). For simple attribute reads, prefer
get_nodes / search_nodes — use GraphQL only when you need relationship
traversal, aggregation, or fields not exposed by the typed tools.
To discover available kinds and their attributes, read the infrahub://schema
resource. If your client does not support MCP resources, call the get_schema
tool instead. For the full GraphQL SDL, read infrahub://graphql-schema.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "query_graphql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | GraphQL query string. Only queries are allowed — use mutate_graphql for mutations. | |
| branch | No | Branch to execute the query against. Defaults to None (uses default branch). |