Skip to main content
Glama

mutate_graphql

Destructive

Execute complex GraphQL mutations on Infrahub for writes that typed tools cannot handle, such as relationship edits or bulk operations. Runs on the active session branch for isolated changes.

Instructions

Execute a GraphQL mutation against Infrahub — use only for complex writes that typed tools can't express.

Prefer node_upsert (create/update scalar attributes) or node_delete (remove a node) for straightforward changes; they validate against the schema and produce clearer audit entries. Reach for mutate_graphql when you need relationship edits, bulk operations, or any mutation shape not covered by the typed tools. For reads, use query_graphql.

The mutation always runs on the active session branch (auto-created on the first write of the session, mcp/session-YYYYMMDD-<hex>). There is no branch override — writes are isolated to the session, and changes reach the default branch only through propose_changes and human review. To target a different branch deliberately, switch the session with reset_session_branch first. Branch- and schema-management mutations are rejected.

To discover available kinds and their attributes, read the infrahub://schema resource or call the get_schema tool. For the full GraphQL SDL, read infrahub://graphql-schema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesGraphQL mutation to execute on the active session branch.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds significant context beyond annotations: mutation runs on active session branch, no branch override, writes are isolated to session, changes need propose_changes for default branch, and branch/schema mutations are rejected. No contradiction with annotations (destructiveHint=true, readOnlyHint=false).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with multiple paragraphs, each adding value: purpose, comparison with siblings, branch behavior, restrictions, and pointers to related resources. No unnecessary words; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Fully explains the tool's behavior, constraints, and integration with other tools (e.g., reset_session_branch, propose_changes). Output schema exists, so return values are covered. No gaps for a complex write tool with a single string parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter ('query') with schema description already stating 'GraphQL mutation to execute on the active session branch.' With 100% schema coverage, the description adds little extra value beyond the param description, though it provides context on allowed mutations and suggests using get_schema for discovery.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a GraphQL mutation against Infrahub and distinguishes it from sibling tools (node_upsert, node_delete, query_graphql) by specifying its use for complex writes, relationship edits, and bulk operations not covered by typed tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly provides when to use (complex writes) and when to avoid (prefer node_upsert/node_delete for straightforward changes, query_graphql for reads). Names alternatives and explains branch behavior and restrictions, giving clear guidance on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/opsmill/infrahub-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server