{
  "openapi": "3.1.0",
  "info": {
    "title": "Preflight MCP API",
    "version": "0.16.0",
    "summary": "Stateless pre-flight decision & evolution API for product and growth agents.",
    "description": "Stateless, read-only user-facing decision and evolution API across UI screens, CTAs, onboarding, pricing, paywalls, brand directions, landing pages, concepts, and ads. decide and evolve compare two variants side by side, in both orders, and force a choice, with 4 answers on the deciding pair. verdict_status is DECISIVE_WIN when all 4 answers agree and TIED_LOW_SIGNAL when they split (too close to call). decide requires at least 2 variants (use evolve when starting from 1). Video ads are not supported yet; search text ads are unproven and carry a low-confidence warning. The endpoint speaks MCP over Streamable HTTP: POST one JSON-RPC 2.0 message per request. Use method \"tools/list\" to enumerate the tools and \"tools/call\" to run one. Mint a free $10 API key (no card) via POST https://preflight.tech/api/billing/signup or at https://preflight.tech/signup, or connect via OAuth 2.1 (PKCE + Dynamic Client Registration at https://preflight.tech/.well-known/oauth-authorization-server). Agent skill: https://preflight.tech/skill.md. MCP Server Card: https://preflight.tech/.well-known/mcp/server-card.json. Full agent docs: https://preflight.tech/llms-full.txt. Human docs: https://preflight.tech/mcp"
  },
  "servers": [
    {
      "url": "https://preflight.tech"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "oauth2": [
        "mcp:tools"
      ]
    }
  ],
  "paths": {
    "/api/billing/signup": {
      "post": {
        "operationId": "signupFreeKey",
        "summary": "Mint a free pf_live_ API key preloaded with $10 at-cost balance (no card required)",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Founder or work email (1 free $10 grant per canonical email)."
                  },
                  "source_page": {
                    "type": "string",
                    "description": "Optional referral source tag (e.g. \"agent\", \"cli\")."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Returns api_key (pf_live_...), balance_cents (1000), balance_usd (10.0), and key_prefix."
          },
          "400": {
            "description": "Invalid or disposable email address."
          },
          "409": {
            "description": "Account already exists for this email."
          },
          "429": {
            "description": "Daily per-IP signup limit reached."
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "Send one MCP JSON-RPC message (tools/list or tools/call)",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "default": "application/json, text/event-stream"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ToolsCall"
                  },
                  {
                    "$ref": "#/components/schemas/ToolsList"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result. Tool output is in result.structuredContent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer key. Mint a free $10 key via POST /api/billing/signup or at /signup."
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Public health check: service status and readiness",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is up."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://preflight.tech/oauth/authorize",
            "tokenUrl": "https://preflight.tech/api/oauth/token",
            "scopes": {
              "mcp:tools": "Run decide, evolve, and report tools on your Preflight account"
            }
          }
        }
      }
    },
    "schemas": {
      "ToolsList": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string"
            ]
          },
          "method": {
            "const": "tools/list"
          },
          "params": {
            "type": "object"
          }
        }
      },
      "ToolsCall": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "method",
          "params"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string"
            ]
          },
          "method": {
            "const": "tools/call"
          },
          "params": {
            "oneOf": [
              {
                "type": "object",
                "title": "decide",
                "required": [
                  "name",
                  "arguments"
                ],
                "properties": {
                  "name": {
                    "const": "decide"
                  },
                  "arguments": {
                    "$ref": "#/components/schemas/decide_arguments"
                  }
                }
              },
              {
                "type": "object",
                "title": "evolve",
                "required": [
                  "name",
                  "arguments"
                ],
                "properties": {
                  "name": {
                    "const": "evolve"
                  },
                  "arguments": {
                    "$ref": "#/components/schemas/evolve_arguments"
                  }
                }
              },
              {
                "type": "object",
                "title": "report",
                "required": [
                  "name",
                  "arguments"
                ],
                "properties": {
                  "name": {
                    "const": "report"
                  },
                  "arguments": {
                    "$ref": "#/components/schemas/report_arguments"
                  }
                }
              }
            ]
          }
        }
      },
      "JsonRpcResult": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string"
            ]
          },
          "result": {
            "type": "object",
            "properties": {
              "isError": {
                "type": "boolean"
              },
              "structuredContent": {
                "type": "object",
                "description": "The tool output as JSON."
              },
              "content": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "decide_arguments": {
        "properties": {
          "variants": {
            "description": "2..N variants to compare (one variant returns an error; call `evolve` to generate alternatives from 1 baseline). Pass plain strings for fast copy/CTA comparisons, or objects: {id, label?, is_baseline?, media=[{url_or_path, role?}] or [url], url?, text?, headline?, subheadline?, body?, cta?, description?, price?, problem?, solution?, current_alternative?, proof?, source_ad?, channel?, format?, device?, metadata?}.",
            "items": {
              "anyOf": [
                {
                  "additionalProperties": true,
                  "type": "object"
                },
                {
                  "type": "string"
                }
              ]
            },
            "title": "Variants",
            "type": "array"
          },
          "audience": {
            "default": "",
            "description": "Target user/buyer description. Leave empty when the user has not said who their buyers are: Preflight then infers them from `audience_url`, a variant `url`, or the variant copy (one small extra model call) and returns them in `meta.audience` with `meta.audience_inferred_from`.",
            "title": "Audience",
            "type": "string"
          },
          "audience_url": {
            "default": "",
            "description": "Optional public https:// website of the product. When `audience` is empty, Preflight reads this page (SSRF-guarded) to infer who the buyers are. Ignored when `audience` or `context.brain.audience` is set.",
            "title": "Audience Url",
            "type": "string"
          },
          "goal": {
            "default": "",
            "description": "Decision goal grounding the comparison and surface inference (e.g. 'maximize free-trial signups', 'pick hero brand identity', 'cut checkout drop-off').",
            "title": "Goal",
            "type": "string"
          },
          "surface": {
            "default": "auto",
            "description": "User-facing surface preset (default: 'auto'). Selects the benchmarked prompt shape for ads, pages/screens, or copy. Aliases (`landing_page_hero`, `ad_copy`, `google_rsa`, `modal`, `email`) are normalized automatically.",
            "enum": [
              "auto",
              "ui",
              "cta",
              "pricing",
              "paywall",
              "onboarding",
              "landing_page",
              "landing_page_hero",
              "brand",
              "ad",
              "ad_copy",
              "google_rsa",
              "modal",
              "email",
              "concept"
            ],
            "title": "Surface",
            "type": "string"
          },
          "search_terms": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional real search queries (`search_term_view`) grounding Google Search RSA ads or Query->Ad->LP message match.",
            "title": "Search Terms"
          },
          "context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional fluid product and buyer context (identical contract across `decide` and `evolve`). Accepts a plain text string (brief, product notes, landing page copy, customer reviews), a bare https:// website URL, a bare BusinessBrain JSON (projected dict or raw `nodes` graph), or any loose dict (`{brain?, buyer_voice?, economics?, ...}`). Preflight automatically distills long or messy context into a clean, neutral 1-2 line grounding for the judge (stripping marketing opinions) and echoes what it understood in `meta.context_used`.",
            "title": "Context"
          },
          "past_results": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/$defs/PastTestResult"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional real past A/B or ad test pairs from the same audience ({winner, loser, metric?, winner_rate?, loser_rate?, note?}; up to 20). Calibrates the judge identically to `evolve`.",
            "title": "Past Results"
          },
          "fetch_url": {
            "default": true,
            "description": "If true (default), SSRF-safely fetches live HTML copy when URL-only variants are supplied.",
            "title": "Fetch Url",
            "type": "boolean"
          },
          "feedback": {
            "default": true,
            "description": "If true (default), runs one extra call showing the top two variants and returns `meta.judge.why_winner` (up to 3 reasons the winner leads) and `next_mutations` (up to 3 changes that would make the runner-up stronger). Set false to skip feedback.",
            "title": "Feedback",
            "type": "boolean"
          },
          "recommend": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Deprecated: the old name of `feedback`, still accepted. False on either one skips the feedback.",
            "title": "Recommend"
          }
        },
        "required": [
          "variants"
        ],
        "type": "object",
        "$defs": {
          "PastTestResult": {
            "additionalProperties": true,
            "description": "One real past A/B or ad test from the same audience/account, used to calibrate `evolve`.",
            "properties": {
              "winner": {
                "description": "Copy, headline, or CTA that won the real test.",
                "title": "Winner",
                "type": "string"
              },
              "loser": {
                "description": "Copy, headline, or CTA that lost the real test.",
                "title": "Loser",
                "type": "string"
              },
              "metric": {
                "default": "",
                "description": "Optional metric measured (e.g. 'ctr', 'cvr', 'cpa', 'roas').",
                "title": "Metric",
                "type": "string"
              },
              "winner_rate": {
                "default": "",
                "description": "Optional winner outcome (e.g. '2.4% CTR', '$12 CPA').",
                "title": "Winner Rate",
                "type": "string"
              },
              "loser_rate": {
                "default": "",
                "description": "Optional loser outcome (e.g. '0.8% CTR', '$21 CPA').",
                "title": "Loser Rate",
                "type": "string"
              },
              "note": {
                "default": "",
                "description": "Optional brief context (e.g. 'same story', 'same ad set').",
                "title": "Note",
                "type": "string"
              }
            },
            "required": [
              "winner",
              "loser"
            ],
            "title": "PastTestResult",
            "type": "object"
          }
        },
        "title": "decideArguments",
        "description": "Pick the likely winner among 2..N user-facing variants using blind forced-choice pairwise comparison. Two variants are shown side by side in both presentation orders, with 4 answers on the deciding pair. `verdict_status='DECISIVE_WIN'` only when all 4 answers agree, else `TIED_LOW_SIGNAL` (too close to call). Returns ranked items (`rank`, `hybrid_score` win share, `metadata.judge`), a `prediction_id` receipt for `report`, and when `feedback=true` (default), `meta.judge.why_winner` (up to 3 reasons the winner leads) plus `next_mutations` (up to 3 concrete changes to strengthen the runner-up). Works across still image ads, landing page / UI / paywall / pricing screenshots, live public URLs (`fetch_url=true`), emails, headlines, CTAs, and product concepts. Passing a single variant returns an error (pass 2+ variants to compare, or call `evolve` to write and compare alternatives). Video variants are unsupported and return an explicit error."
      },
      "evolve_arguments": {
        "properties": {
          "baseline_assets": {
            "default": [],
            "description": "1-15 baseline variants to beat (plain strings for copy, or objects {id?, media?, headline?, subheadline?, primary_text?, description?, cta?, on_image_text?, angle?}). Include `media` (e.g. `['https://...']`) to trigger cooperative image evolution. May be empty on follow-up image rounds when `previous_state` is passed.",
            "items": {
              "anyOf": [
                {
                  "additionalProperties": true,
                  "type": "object"
                },
                {
                  "type": "string"
                }
              ]
            },
            "title": "Baseline Assets",
            "type": "array"
          },
          "surface": {
            "default": "ui",
            "description": "User-facing surface to evolve (default: 'ui'). Use 'ad' for image ads and 'landing_page'/'ui' for page/app screens.",
            "enum": [
              "ui",
              "cta",
              "onboarding",
              "paywall",
              "pricing",
              "modal",
              "landing_page",
              "landing_page_hero",
              "brand",
              "ad",
              "ad_copy",
              "google_rsa",
              "concept"
            ],
            "title": "Surface",
            "type": "string"
          },
          "audience": {
            "default": "",
            "description": "Target user/buyer description including market, language, and currency (optional if `context` or `audience_url` is set).",
            "title": "Audience",
            "type": "string"
          },
          "audience_url": {
            "default": "",
            "description": "Optional website URL for the product being evolved. When `audience` and `context` are empty, Preflight reads this page to infer the target buyers and extract neutral product facts identically to `decide`.",
            "title": "Audience Url",
            "type": "string"
          },
          "goal": {
            "default": "",
            "description": "Target user action or conversion goal (e.g. 'increase free-trial starts', 'reduce paywall bounce').",
            "title": "Goal",
            "type": "string"
          },
          "context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional fluid product and buyer context (identical contract across `decide` and `evolve`). Accepts a plain text string (brief, product notes, landing page copy, customer reviews), a bare https:// website URL, a bare BusinessBrain JSON (projected dict or raw `nodes` graph), or any loose dict (`{brain?, buyer_voice?, economics?, ...}`). Preflight compiles it once: the judge gets the exact same clean, neutral 1-2 line grounding as `decide` (stripping marketing opinions), while the writer and compliance gates automatically extract all concrete facts, offers, numbers, buyer quotes, and banned claims. Returned in `meta.context_used`.",
            "title": "Context"
          },
          "channel": {
            "default": "",
            "description": "Optional channel ('web', 'ios', 'android', 'google_search', 'meta', 'tiktok').",
            "title": "Channel",
            "type": "string"
          },
          "max_chars": {
            "anyOf": [
              {
                "maximum": 280,
                "minimum": 5,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional strict character-length gate enforced at $0 before scoring (auto 32 for `cta`, 30 for `google_rsa`).",
            "title": "Max Chars"
          },
          "search_terms": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional real top 5-10 NON-BRAND `search_term_view` queries for `google_rsa` or hero message match.",
            "title": "Search Terms"
          },
          "keep_assets": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Existing live winners kept in rotation; evolved winners are guaranteed NOT to duplicate them.",
            "title": "Keep Assets"
          },
          "verified_facts": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Approved prices, stats, limits, or guarantees allowed in mutations (prevents invented claims).",
            "title": "Verified Facts"
          },
          "banned_claims": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Hard-forbidden claims/phrases rejected deterministically at $0 before scoring.",
            "title": "Banned Claims"
          },
          "past_results": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/$defs/PastTestResult"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional real past A/B or ad test pairs from the same audience ({winner, loser, metric?, winner_rate?, loser_rate?, note?}; up to 20). Calibrates both the writer and judge on what this audience actually responds to; facts and wording from past tests are never reused.",
            "title": "Past Results"
          },
          "candidates": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional newly rendered image candidates for cooperative image evolution, matching IDs from the previous call's `next_briefs` ({id, media: ['https://...'], on_image_text?, headline?, primary_text?, cta?, angle?, origin?, parent_id?}). Omitted copy/angle metadata is automatically restored from `previous_state` by matching `id`.",
            "title": "Candidates"
          },
          "previous_state": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Stateless `state` object returned by the previous cooperative image `evolve` call. Pass it back along with newly rendered `candidates` so Preflight continues round tracking, carried leaders, losing angles, and cumulative pairwise votes without re-judging prior pairs.",
            "title": "Previous State"
          },
          "finalize": {
            "default": false,
            "description": "For cooperative image evolution: set true on your final rendered batch to skip proposing more `next_briefs`, run the Top-3 finalist shootout and fresh 4-answer exit check against the baseline, and return final winners (`awaiting_render=false`).",
            "title": "Finalize",
            "type": "boolean"
          },
          "strict_facts": {
            "default": true,
            "description": "When true (default) and `verified_facts` is non-empty, reject candidates introducing ungrounded numeric stats/prices/years.",
            "title": "Strict Facts",
            "type": "boolean"
          },
          "top_k": {
            "default": 4,
            "description": "Number of diverse winning replacements to return (default: 4).",
            "maximum": 10,
            "minimum": 1,
            "title": "Top K",
            "type": "integer"
          },
          "candidates_per_round": {
            "default": 6,
            "description": "Mutation candidates scored per round (default: 6).",
            "maximum": 10,
            "minimum": 2,
            "title": "Candidates Per Round",
            "type": "integer"
          },
          "max_rounds": {
            "anyOf": [
              {
                "maximum": 4,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Refinement rounds. Leave it out (recommended): `evolve` then runs up to 3 rounds and stops as soon as a round leaves the top pick unchanged. Pass a number to run up to that many rounds instead; it still stops early on plateau or budget cap.",
            "title": "Max Rounds"
          },
          "max_budget_usd": {
            "default": 5,
            "description": "Compute-credit budget cap across rounds in USD (default: 5.00; stops before starting a new round at cap).",
            "maximum": 15,
            "minimum": 0.15,
            "title": "Max Budget Usd",
            "type": "number"
          },
          "max_token_overlap": {
            "default": 0.6,
            "description": "Max pairwise Jaccard token overlap between selected winners and `keep_assets` (default: 0.60).",
            "maximum": 0.95,
            "minimum": 0.2,
            "title": "Max Token Overlap",
            "type": "number"
          },
          "max_stat_repeats": {
            "default": 1,
            "description": "Max times any single numeric proof stat may repeat across final Top-K (default: 1; 0=unlimited).",
            "maximum": 5,
            "minimum": 0,
            "title": "Max Stat Repeats",
            "type": "integer"
          },
          "explore_ratio": {
            "default": 1,
            "description": "Share of each round's new candidates that are fresh, orthogonal angles; the rest are small surgical edits, with at least one of each. Default 1.0 (wide): small rewrites rarely differ in real results. Lower it for more small edits.",
            "maximum": 1,
            "minimum": 0,
            "title": "Explore Ratio",
            "type": "number"
          }
        },
        "type": "object",
        "$defs": {
          "PastTestResult": {
            "additionalProperties": true,
            "description": "One real past A/B or ad test from the same audience/account, used to calibrate `evolve`.",
            "properties": {
              "winner": {
                "description": "Copy, headline, or CTA that won the real test.",
                "title": "Winner",
                "type": "string"
              },
              "loser": {
                "description": "Copy, headline, or CTA that lost the real test.",
                "title": "Loser",
                "type": "string"
              },
              "metric": {
                "default": "",
                "description": "Optional metric measured (e.g. 'ctr', 'cvr', 'cpa', 'roas').",
                "title": "Metric",
                "type": "string"
              },
              "winner_rate": {
                "default": "",
                "description": "Optional winner outcome (e.g. '2.4% CTR', '$12 CPA').",
                "title": "Winner Rate",
                "type": "string"
              },
              "loser_rate": {
                "default": "",
                "description": "Optional loser outcome (e.g. '0.8% CTR', '$21 CPA').",
                "title": "Loser Rate",
                "type": "string"
              },
              "note": {
                "default": "",
                "description": "Optional brief context (e.g. 'same story', 'same ad set').",
                "title": "Note",
                "type": "string"
              }
            },
            "required": [
              "winner",
              "loser"
            ],
            "title": "PastTestResult",
            "type": "object"
          }
        },
        "title": "evolveArguments",
        "description": "Natural selection for copy and images, run before launch. For copy: runs a full multi-round write, lint, and rank loop in one call (decoupled unanchored fresh angles plus contrastive surgical edits, Challengers-vs-Leaders BTL ranking, Top-3 4-answer finalist shootout, and fresh 4-answer exit check). For images (cooperative mode, auto-triggered whenever any item in `baseline_assets` or `candidates` includes `media`, or when `previous_state` resumes an image run): Preflight does not generate images itself. Instead, each call executes one stateless round: it compares your rendered images visually head-to-head with the benchmarked vision judge and returns `awaiting_render=true`, render-ready `next_briefs` (visual prompt, linted `on_image_text`/copy, `parent_id` for edits), and `state`. Render `next_briefs` with your own image generator or design tool, then call `evolve` again with `candidates` + `previous_state=state` until `awaiting_render` is false (or pass `finalize=true` on your final batch). Candidates are compared with the direct forced-choice judge (both presentation orders) and the final winner must beat the baseline in a fresh 4-answer check, or `overfit_warning` is set; pass real `past_results` from the same audience when available to calibrate both writer and judge. Validate the top 2-3 diverse variants from `final_winners` in a live test. Supports surfaces: `ui`, `cta`, `onboarding`, `paywall`, `pricing`, `modal`, `landing_page`, `landing_page_hero`, `brand`, `ad`, `ad_copy`, `google_rsa`, `concept`."
      },
      "report_arguments": {
        "properties": {
          "outcomes": {
            "description": "Real performance rows matching variant IDs: {id, impressions?, clicks?, conversions?, spend?, sample_size?, cpa?, ctr?, cvr?, roas?, metric_value?, started_at?, ended_at?}. Include exposure (`impressions >= 200`, `clicks >= 20`, `conversions >= 5`, `spend >= 10`, or `sample_size >= 100`) per row to unlock the 100% rebate.",
            "items": {
              "$ref": "#/$defs/OutcomeRow"
            },
            "title": "Outcomes",
            "type": "array"
          },
          "prediction_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Pre-registered receipt ID returned by a prior `decide` or `evolve` request. Required for automatic 100% credit rebates and account run-history grading.",
            "title": "Prediction Id"
          },
          "metric_name": {
            "default": "cpa",
            "description": "Metric to grade against: 'cpa', 'cpl', 'cpi', 'ctr', 'cvr', 'roas', 'cpm', or 'metric_value'.",
            "title": "Metric Name",
            "type": "string"
          },
          "higher_is_better": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Override directionality (auto-inferred: false for cpa/cpl/cpi/cpm/cpc, true for ctr/cvr/roas/metric_value).",
            "title": "Higher Is Better"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional ISO-8601 start timestamp for the live test window (used for same-era hygiene checks).",
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional ISO-8601 end timestamp for the live test window.",
            "title": "Ended At"
          },
          "variants": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Original tested variants matching the `prediction_id`. Verified against the pre-registered SHA-256 hashes to unlock the 100% credit rebate and opt-in to anonymized training data.",
            "title": "Variants"
          },
          "public": {
            "default": false,
            "description": "Opt in to publish this anonymized test result in Preflight's public benchmark feed (default: false).",
            "title": "Public",
            "type": "boolean"
          },
          "public_label": {
            "default": "",
            "description": "Optional short anonymized label shown when `public=true` (e.g. 'SaaS pricing page hero').",
            "title": "Public Label",
            "type": "string"
          },
          "evaluation": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Optional stateless `EvaluationResult` from `decide` when grading locally without a `prediction_id`.",
            "title": "Evaluation"
          }
        },
        "required": [
          "outcomes"
        ],
        "type": "object",
        "$defs": {
          "OutcomeRow": {
            "additionalProperties": true,
            "description": "One variant's real post-launch performance row passed to `report`.",
            "properties": {
              "id": {
                "description": "Variant ID matching the `decide` or `evolve` output.",
                "title": "Id",
                "type": "string"
              },
              "impressions": {
                "anyOf": [
                  {
                    "minimum": 0,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Impressions or page views observed for this variant.",
                "title": "Impressions"
              },
              "clicks": {
                "anyOf": [
                  {
                    "minimum": 0,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Clicks or CTA taps observed.",
                "title": "Clicks"
              },
              "conversions": {
                "anyOf": [
                  {
                    "minimum": 0,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Conversions, signups, or purchases observed.",
                "title": "Conversions"
              },
              "spend": {
                "anyOf": [
                  {
                    "minimum": 0,
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Ad spend in account currency.",
                "title": "Spend"
              },
              "sample_size": {
                "anyOf": [
                  {
                    "minimum": 0,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Visitors, recipients, or users exposed (alternative to impressions).",
                "title": "Sample Size"
              },
              "cpa": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Cost per acquisition (lower is better).",
                "title": "Cpa"
              },
              "cpl": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Cost per lead (lower is better).",
                "title": "Cpl"
              },
              "cpi": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Cost per install (lower is better).",
                "title": "Cpi"
              },
              "ctr": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Click-through rate (higher is better).",
                "title": "Ctr"
              },
              "cvr": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Conversion rate (higher is better).",
                "title": "Cvr"
              },
              "roas": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Return on ad spend (higher is better).",
                "title": "Roas"
              },
              "cpm": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Cost per 1,000 impressions (lower is better).",
                "title": "Cpm"
              },
              "metric_value": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Generic primary metric value.",
                "title": "Metric Value"
              },
              "started_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Optional ISO-8601 timestamp when this variant went live.",
                "title": "Started At"
              },
              "ended_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Optional ISO-8601 timestamp when this variant stopped.",
                "title": "Ended At"
              }
            },
            "required": [
              "id"
            ],
            "title": "OutcomeRow",
            "type": "object"
          }
        },
        "title": "reportArguments",
        "description": "Submit real post-launch results ($0, zero-LLM) for a prior `decide` or `evolve` `prediction_id` to grade accuracy, verify same-era outcome hygiene, and earn an automatic 100% credit rebate when supplied `variants` match the pre-registered SHA-256 hashes (up to the monthly cap). For rebate eligibility, each variant row in `outcomes` must include exposure meeting at least one minimum (`impressions >= 200`, `clicks >= 20`, `conversions >= 5`, `spend >= 10`, or `sample_size >= 100`) and non-zero metric spread. Alternatively, omit `prediction_id` and pass `evaluation` for pure stateless NumPy grading."
      }
    }
  },
  "x-mcp": {
    "transport": "streamable-http",
    "stateless": true,
    "serverCard": "https://preflight.tech/.well-known/mcp/server-card.json",
    "oauthProtectedResource": "https://preflight.tech/.well-known/oauth-protected-resource",
    "tools": [
      {
        "name": "decide",
        "title": "Decide (Compare & Rank Variants)",
        "readOnly": true
      },
      {
        "name": "evolve",
        "title": "Evolve (Optimize Copy, Visuals, CTAs, Offers & Ads)",
        "readOnly": true
      },
      {
        "name": "report",
        "title": "Report (Grade Real Outcomes & Earn 100% Credit Rebates)",
        "readOnly": false
      }
    ]
  }
}