Skip to main content
Glama

NAIF Agent Gravity — MCP Diagnostics & Recovery

Prepare Repair

prepare_repair
Idempotent

Use ONLY for the normal repair flow after quote_repair has already returned a quoteId and the caller explicitly chooses that existing quote. This tool does not create a quote: with confirm=true it records acceptance of that quote and creates checkout instructions on exactly one rail offered by it. Do NOT use this tool for owner/platform-preauthorized autonomous purchasing where the agent is allowed to choose one of the four capped micro-services and create its own quote; use request_delegated_purchase for that separate flow. APPLE_PAY returns a human handoff URL for buyer authorization; BASE_USDC and TRON_USDT return payer transfer instructions. It never sends funds, charges the caller, verifies payment or directly starts repair execution. After the buyer completes the required payment action, use verify_repair with the returned checkoutId and the same rail.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
railYesChoose exactly one id from the descriptors in quote_repair.paymentRails. Saudi quotes normally offer APPLE_PAY only.
sourceNoOptional attribution label for the calling agent or integration.
confirmYesMust be true to record explicit acceptance before checkout instructions are created.
quoteIdYesExact quoteId returned by quote_repair and explicitly accepted by the caller.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
railNoSelected payment rail.
errorNoPresent when quote acceptance or checkout preparation failed.
phaseNoPREPARE_REPAIR on success.
quoteIdNoAccepted quote identifier.
checkoutNoCheckout record/instructions returned for the selected rail; includes the checkout identifier used by verify_repair.
nextToolNoverify_repair after the buyer completes the payment action.
fundsSentNoFalse; this tool does not send funds.
nextActionNoFor APPLE_PAY, human handoff information; for wallet rails, payer transfer instructions.
automaticJobNoFalse; this preparation step does not start a repair job.
paymentVerifiedNoFalse until verify_repair confirms an existing payment.
quoteAcceptanceNoCommerce acknowledgement that the quote was accepted.
automaticPaymentNoFalse; no automatic charge or transfer occurs.
automaticExecutionNoFalse; this preparation step does not directly execute repair.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / rail / description
      Previous value: -"Choose exactly one rail offered in quote_repair.paymentRails. Saudi quotes normally offer APPLE_PAY only."New value: +"Choose exactly one id from the descriptors in quote_repair.paymentRails. Saudi quotes normally offer APPLE_PAY only."
  2. Changed5 schema fields changed
    • addedInput schema / properties / confirm / description
      Added value: +"Must be true to record explicit acceptance before checkout instructions are created."
    • addedInput schema / properties / quoteId / description
      Added value: +"Exact quoteId returned by quote_repair and explicitly accepted by the caller."
    • changedInput schema / properties / rail / description
      Previous value: -"Choose exactly one rail offered by quote_repair."New value: +"Choose exactly one rail offered in quote_repair.paymentRails. Saudi quotes normally offer APPLE_PAY only."
    • addedInput schema / properties / source / description
      Added value: +"Optional attribution label for the calling agent or integration."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "Accepted quote plus checkout instructions. A successful result includes checkout information and nextTool=verify_repair; no funds are sent by this tool.",
      +  "properties": {
      +    "automaticExecution": {
      +      "description": "False; this preparation step does not directly execute repair.",
      +      "type": "boolean"
      +    },
      +    "automaticJob": {
      +      "description": "False; this preparation step does not start a repair job.",
      +      "type": "boolean"
      +    },
      +    "automaticPayment": {
      +      "description": "False; no automatic charge or transfer occurs.",
      +      "type": "boolean"
      +    },
      +    "checkout": {
      +      "additionalProperties": true,
      +      "description": "Checkout record/instructions returned for the selected rail; includes the checkout identifier used by verify_repair.",
      +      "type": "object"
      +    },
      +    "error": {
      +      "description": "Present when quote acceptance or checkout preparation failed.",
      +      "type": "string"
      +    },
      +    "fundsSent": {
      +      "description": "False; this tool does not send funds.",
      +      "type": "boolean"
      +    },
      +    "nextAction": {
      +      "additionalProperties": true,
      +      "description": "For APPLE_PAY, human handoff information; for wallet rails, payer transfer instructions.",
      +      "type": "object"
      +    },
      +    "nextTool": {
      +      "description": "verify_repair after the buyer completes the payment action.",
      +      "type": "string"
      +    },
      +    "paymentVerified": {
      +      "description": "False until verify_repair confirms an existing payment.",
      +      "type": "boolean"
      +    },
      +    "phase": {
      +      "description": "PREPARE_REPAIR on success.",
      +      "type": "string"
      +    },
      +    "quoteAcceptance": {
      +      "additionalProperties": true,
      +      "description": "Commerce acknowledgement that the quote was accepted.",
      +      "type": "object"
      +    },
      +    "quoteId": {
      +      "description": "Accepted quote identifier.",
      +      "type": "string"
      +    },
      +    "rail": {
      +      "description": "Selected payment rail.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed3 schema fields changed
    • addedInput schema / properties / rail / description
      Added value: +"Choose exactly one rail offered by quote_repair."
    • changedInput schema / properties / rail / enum
      Previous value: -[
      -  "BASE_USDC",
      -  "TRON_USDT"
      -]New value: +[
      +  "APPLE_PAY",
      +  "BASE_USDC",
      +  "TRON_USDT"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "quoteId",
      -  "confirm"
      -]New value: +[
      +  "quoteId",
      +  "confirm",
      +  "rail"
      +]
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial behavior beyond annotations: APPLE_PAY returns a human handoff URL while BASE_USDC/TRON_USDT return payer transfer instructions. Explicitly states it never sends funds, charges the caller, verifies payment, or starts repair execution. This compensates for idempotentHint scope, which annotations alone do not unpack.

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?

Front-loads the primary condition (ONLY for normal repair flow after quote_repair), then covers exclusions, rail behaviors, non-effects, and the follow-up step in a tight sequence. No filler sentences; every clause carries distinct information.

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?

For a mutation tool with an output schema present, the description covers when to use it, what it does and does not do, per-rail outcomes, and the next tool call. Nothing needed to invoke it correctly is missing, and return values are delegated to the output schema.

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?

Schema description coverage is 100%, so the schema already documents rail, confirm, source, and quoteId. The description reinforces that exactly one enumerated rail id from quote_repair.paymentRails is required and that confirm must be true, but adds no format or syntax beyond the schema. Baseline 3 applies.

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?

States a specific verb and resource: with confirm=true it records acceptance of an existing quote and creates checkout instructions on exactly one rail. It explicitly distinguishes from quote_repair (does not create a quote) and request_delegated_purchase (separate autonomous flow).

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?

Gives explicit when-to-use (after quote_repair returned a quoteId and caller explicitly chose it) and when-not-to-use (owner/platform-preauthorized autonomous purchasing), naming the alternative tool request_delegated_purchase. Also prescribes the next step (verify_repair) and the exact inputs to pass.

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.