Skip to main content
Glama

Repair this invalid OpenQASM 3 program conservatively, or tell me exactly why a safe repair cannot be made.

repair_openqasm3
Idempotent

Repair this invalid OpenQASM 3 program conservatively, or tell me exactly why a safe repair cannot be made.

Input Schema

NameRequiredDescriptionDefault
requestYes
payment_railNo
idempotency_keyYes
max_total_priceYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "capability_id": {
      -        "enum": [
      -          "circuit-assurance-report-v1",
      -          "supported-circuit-equivalence-v1",
      -          "openqasm3-repair-v1",
      -          "verified-circuit-optimization-v1",
      -          "failed-workflow-diagnosis-v1",
      -          "optimization-preservation-audit-v1",
      -          "cross-provider-portability-v1",
      -          "phase-sensitive-inspection-v1",
      -          "two-qubit-target-synthesis-v1",
      -          "two-qubit-local-equivalence-v1"
      -        ],
      -        "type": "string"
      -      },
      -      "capability_version": {
      -        "const": "1.0.0",
      -        "type": "string"
      -      },
      -      "catalog_digest": {
      -        "pattern": "^[a-f0-9]{64}$",
      -        "type": "string"
      -      },
      -      "catalog_revision": {
      -        "maxLength": 128,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "commercial_state": {
      -        "enum": [
      -          "commit_pending",
      -          "committed",
      -          "settlement_pending",
      -          "settled",
      -          "release_pending",
      -          "released"
      -        ],
      -        "type": "string"
      -      },
      -      "duplicate": {
      -        "type": "boolean"
      -      },
      -      "job_id": {
      -        "maxLength": 256,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "max_total_price": {
      -        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d{1,6})?$",
      -        "type": "string"
      -      },
      -      "payment_rail": {
      -        "enum": [
      -          "x402",
      -          "account_core_balance"
      -        ],
      -        "type": "string"
      -      },
      -      "price": {
      -        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d{1,6})?$",
      -        "type": "string"
      -      },
      -      "product": {
      -        "const": "quantum",
      -        "type": "string"
      -      },
      -      "quote_expires_at": {
      -        "format": "date-time",
      -        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      -        "type": "string"
      -      },
      -      "quote_id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      },
      -      "request_hash": {
      -        "pattern": "^[a-f0-9]{64}$",
      -        "type": "string"
      -      },
      -      "request_schema_version": {
      -        "maxLength": 128,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "reservation_id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      },
      -      "retrieval_token": {
      -        "maxLength": 512,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "retrieval_token_expires_in": {
      -        "exclusiveMinimum": 0,
      -        "maximum": 9007199254740991,
      -        "type": "integer"
      -      },
      -      "rqm_account_id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      },
      -      "schema_version": {
      -        "const": "rqm.jobs.studio-agent-job.v1",
      -        "type": "string"
      -      },
      -      "status": {
      -        "enum": [
      -          "queued",
      -          "running",
      -          "completed",
      -          "failed",
      -          "cancelled"
      -        ],
      -        "type": "string"
      -      },
      -      "tariff_version": {
      -        "const": "rqm-studio-agent-usdc-v1",
      -        "type": "string"
      -      },
      -      "tool_name": {
      -        "enum": [
      -          "check_quantum_circuit",
      -          "compare_quantum_circuits",
      -          "repair_openqasm3",
      -          "optimize_quantum_circuit",
      -          "diagnose_quantum_workflow",
      -          "audit_quantum_transformation",
      -          "translate_quantum_circuit",
      -          "diagnose_quantum_phase",
      -          "synthesize_two_qubit_target",
      -          "classify_two_qubit_operation"
      -        ],
      -        "type": "string"
      -      },
      -      "x402_settlement_id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      },
      -      "x402_transaction_id": {
      -        "maxLength": 256,
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "schema_version",
      -      "product",
      -      "tool_name",
      -      "capability_id",
      -      "capability_version",
      -      "request_schema_version",
      -      "catalog_revision",
      -      "catalog_digest",
      -      "request_hash",
      -      "job_id",
      -      "status",
      -      "rqm_account_id",
      -      "quote_id",
      -      "reservation_id",
      -      "duplicate",
      -      "commercial_state",
      -      "payment_rail",
      -      "price",
      -      "max_total_price",
      -      "tariff_version",
      -      "quote_expires_at"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "code": {
      -        "enum": [
      -          "AUTHENTICATION_REQUIRED",
      -          "MACHINE_AUTHENTICATION_FAILED",
      -          "MACHINE_AUTHORIZATION_FAILED",
      -          "ACCOUNT_CORE_UNAVAILABLE",
      -          "FEATURE_DISABLED",
      -          "QUOTE_NOT_ENTITLED",
      -          "QUOTE_IDEMPOTENCY_CONFLICT",
      -          "QUOTE_NOT_AVAILABLE",
      -          "QUOTE_REQUEST_INVALID",
      -          "QUOTE_MISMATCH",
      -          "PRICE_LIMIT_EXCEEDED",
      -          "RUNTIME_LIMIT_EXCEEDED",
      -          "ARTIFACT_PREFERENCE_UNAVAILABLE",
      -          "INSUFFICIENT_BALANCE",
      -          "RESERVATION_FAILED",
      -          "PRODUCT_REJECTED",
      -          "PRODUCT_UNAVAILABLE",
      -          "JOB_NOT_FOUND",
      -          "JOB_NOT_READY",
      -          "JOB_ACCESS_DENIED",
      -          "SETTLEMENT_FAILED",
      -          "FUNDING_UNAVAILABLE",
      -          "FUNDING_FAILED"
      -        ],
      -        "type": "string"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "retryable": {
      -        "type": "boolean"
      -      },
      -      "schema_version": {
      -        "const": "rqm.jobs.error.v1",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "schema_version",
      -      "code",
      -      "message",
      -      "retryable"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "capability_id": {
      +        "enum": [
      +          "circuit-assurance-report-v1",
      +          "supported-circuit-equivalence-v1",
      +          "openqasm3-repair-v1",
      +          "verified-circuit-optimization-v1",
      +          "failed-workflow-diagnosis-v1",
      +          "optimization-preservation-audit-v1",
      +          "cross-provider-portability-v1",
      +          "phase-sensitive-inspection-v1",
      +          "two-qubit-target-synthesis-v1",
      +          "two-qubit-local-equivalence-v1"
      +        ],
      +        "type": "string"
      +      },
      +      "capability_version": {
      +        "const": "1.0.0",
      +        "type": "string"
      +      },
      +      "catalog_digest": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "type": "string"
      +      },
      +      "catalog_revision": {
      +        "maxLength": 128,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "commercial_state": {
      +        "enum": [
      +          "commit_pending",
      +          "committed",
      +          "settlement_pending",
      +          "settled",
      +          "release_pending",
      +          "released"
      +        ],
      +        "type": "string"
      +      },
      +      "duplicate": {
      +        "type": "boolean"
      +      },
      +      "job_id": {
      +        "maxLength": 256,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "max_total_price": {
      +        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d{1,6})?$",
      +        "type": "string"
      +      },
      +      "payment_rail": {
      +        "enum": [
      +          "x402",
      +          "account_core_balance"
      +        ],
      +        "type": "string"
      +      },
      +      "price": {
      +        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d{1,6})?$",
      +        "type": "string"
      +      },
      +      "product": {
      +        "const": "quantum",
      +        "type": "string"
      +      },
      +      "quote_expires_at": {
      +        "anyOf": [
      +          {
      +            "format": "date-time",
      +            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +            "type": "string"
      +          },
      +          {
      +            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +            "type": "string"
      +          }
      +        ],
      +        "format": "date-time",
      +        "type": "string"
      +      },
      +      "quote_id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      },
      +      "request_hash": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "type": "string"
      +      },
      +      "request_schema_version": {
      +        "maxLength": 128,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "reservation_id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      },
      +      "retrieval_token": {
      +        "maxLength": 512,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "retrieval_token_expires_in": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "rqm_account_id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      },
      +      "schema_version": {
      +        "const": "rqm.jobs.studio-agent-job.v1",
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "queued",
      +          "running",
      +          "completed",
      +          "failed",
      +          "cancelled"
      +        ],
      +        "type": "string"
      +      },
      +      "tariff_version": {
      +        "const": "rqm-studio-agent-usdc-v1",
      +        "type": "string"
      +      },
      +      "tool_name": {
      +        "enum": [
      +          "check_quantum_circuit",
      +          "compare_quantum_circuits",
      +          "repair_openqasm3",
      +          "optimize_quantum_circuit",
      +          "diagnose_quantum_workflow",
      +          "audit_quantum_transformation",
      +          "translate_quantum_circuit",
      +          "diagnose_quantum_phase",
      +          "synthesize_two_qubit_target",
      +          "classify_two_qubit_operation"
      +        ],
      +        "type": "string"
      +      },
      +      "x402_settlement_id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      },
      +      "x402_transaction_id": {
      +        "maxLength": 256,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "schema_version",
      +      "product",
      +      "tool_name",
      +      "capability_id",
      +      "capability_version",
      +      "request_schema_version",
      +      "catalog_revision",
      +      "catalog_digest",
      +      "request_hash",
      +      "job_id",
      +      "status",
      +      "rqm_account_id",
      +      "quote_id",
      +      "reservation_id",
      +      "duplicate",
      +      "commercial_state",
      +      "payment_rail",
      +      "price",
      +      "max_total_price",
      +      "tariff_version",
      +      "quote_expires_at"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "code": {
      +        "enum": [
      +          "AUTHENTICATION_REQUIRED",
      +          "MACHINE_AUTHENTICATION_FAILED",
      +          "MACHINE_AUTHORIZATION_FAILED",
      +          "ACCOUNT_CORE_UNAVAILABLE",
      +          "FEATURE_DISABLED",
      +          "QUOTE_NOT_ENTITLED",
      +          "QUOTE_IDEMPOTENCY_CONFLICT",
      +          "QUOTE_NOT_AVAILABLE",
      +          "QUOTE_REQUEST_INVALID",
      +          "QUOTE_MISMATCH",
      +          "PRICE_LIMIT_EXCEEDED",
      +          "RUNTIME_LIMIT_EXCEEDED",
      +          "ARTIFACT_PREFERENCE_UNAVAILABLE",
      +          "INSUFFICIENT_BALANCE",
      +          "RESERVATION_FAILED",
      +          "PRODUCT_REJECTED",
      +          "PRODUCT_UNAVAILABLE",
      +          "JOB_NOT_FOUND",
      +          "JOB_NOT_READY",
      +          "JOB_ACCESS_DENIED",
      +          "SETTLEMENT_FAILED",
      +          "FUNDING_UNAVAILABLE",
      +          "FUNDING_FAILED"
      +        ],
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "retryable": {
      +        "type": "boolean"
      +      },
      +      "schema_version": {
      +        "const": "rqm.jobs.error.v1",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "schema_version",
      +      "code",
      +      "message",
      +      "retryable"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. First observed

TDQS

C2.2/5.0
Behavior3/5

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

Annotations already declare write/idempotent/non-destructive/non-open-world, so the safety bar is lower. The description adds real value beyond them by promising conservative repairs and an explicit refusal-with-explanation path, but it omits critical behavior for a paid operation: max_total_price and payment_rail are required yet nothing says the call costs money or how billing is settled.

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

Conciseness3/5

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

It is a single front-loaded sentence with no padding, so structurally it is tight. But brevity here reflects under-specification rather than economy: the whole definition is one sentence duplicated from the title, leaving nothing to orient the caller.

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

Completeness2/5

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

An output schema exists so return values need not be explained, but the tool is a paid mutation with a nested request object, 3 required params, and 0% schema coverage. For that complexity the description is far too thin: pricing, idempotency, and the meaning of the repair policy are all unexplained.

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

Parameters1/5

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

Schema description coverage is 0% across four parameters including a nested request object, an idempotency_key, a payment rail enum, and a price cap. The description mentions no parameter at all, so an agent gets zero meaning about what 'conservative' constrains, why an idempotency key is mandatory, or what max_total_price bounds.

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

Purpose2/5

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

Tautological: description restates name/title.

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

Usage Guidelines2/5

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

The word 'invalid' hints the input is expected to be a failing program, but there is no explicit when-to-use statement, no prerequisite (e.g. run preflight first), and no named alternative such as the preflight or check tools. An agent must guess the sequencing on its own.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources