Skip to main content
Glama

mutate_graphql

Destructive

Perform GraphQL mutations on Infrahub for complex writes such as relationship edits or bulk operations that simple typed tools cannot handle.

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 targets the session branch by default, which is auto-created on the first write of the session (mcp/session-YYYYMMDD-<hex>).

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.
branchNoBranch to execute the mutation against. Defaults to the auto-created session branch (recommended). Override only when targeting a specific non-default branch.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Discloses that mutations target an auto-created session branch by default, complementing annotations (destructiveHint=true) with concrete behavioral context. No contradiction with annotations.

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?

Extremely concise yet packed with essential information: purpose, usage guidelines, branch behavior, and pointers to schema resources. No superfluous text.

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?

With an output schema present, the description does not need to detail returns. It covers parameters, usage context, and references schema discovery resources, making it fully complete.

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

Parameters4/5

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

Schema coverage is 100%, and description adds extra context for the 'branch' parameter (default behavior, recommendation), though 'query' parameter is not elaborated further.

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 verb 'Execute a GraphQL mutation' against 'Infrahub', and immediately distinguishes itself from typed tools like node_upsert and node_delete for complex writes.

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 advises preferring node_upsert/node_delete for straightforward changes and query_graphql for reads, giving clear when-to-use and when-not-to-use guidance.

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