{
 "openapi": "3.1.0",
 "info": {
  "title": "Precise",
  "version": "0.1.0",
  "summary": "Precise measures a live campaign every day, makes the next change wherever the buy is decided, and proves the gain against the setup left as it was.",
  "description": "One API behind the app, the docs and the MCP server. Every screen of the app is one or two of these operations."
 },
 "servers": [
  {
   "url": "{accessOrigin}",
   "description": "Your unified Access deployment. The default is the local public-test server.",
   "variables": {
    "accessOrigin": {
     "default": "http://127.0.0.1:8787"
    }
   }
  }
 ],
 "tags": [
  {
   "name": "Home",
   "description": "One number, one decision."
  },
  {
   "name": "Decision",
   "description": "What changes, what we expect, what it is compared with, what it costs. Then approve."
  },
  {
   "name": "Scorekeeper",
   "description": "Forecast against result, where the money went, and every deal."
  },
  {
   "name": "How Precise can act",
   "description": "Three modes, your rules, your spend limits, one holdout number."
  },
  {
   "name": "Connections",
   "description": "What is connected, what each connection unlocks."
  },
  {
   "name": "Expert",
   "description": "The query behind each number, proof files, and this API."
  }
 ],
 "paths": {
  "/api/v1/overview": {
   "get": {
    "operationId": "overview",
    "summary": "Home",
    "description": "The month's one number, the next decision, the mode in one word, and how much is connected.",
    "tags": [
     "Home"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "The month's one number, the next decision, the mode in one word, and how much is connected.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "account": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string"
            },
            "orders": {
             "type": "integer"
            },
            "media_spend": {
             "$ref": "#/components/schemas/Figure"
            }
           },
           "required": [
            "name",
            "orders",
            "media_spend"
           ]
          },
          "period": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "label": {
             "type": "string"
            },
            "start": {
             "type": "string"
            },
            "end": {
             "type": "string"
            }
           },
           "required": [
            "id",
            "label",
            "start",
            "end"
           ]
          },
          "headline": {
           "$ref": "#/components/schemas/Figure"
          },
          "landed": {
           "type": "object",
           "properties": {
            "inside": {
             "type": "integer"
            },
            "scored": {
             "type": "integer"
            },
            "sentence": {
             "type": "string"
            }
           },
           "required": [
            "inside",
            "scored",
            "sentence"
           ]
          },
          "decision": {
           "anyOf": [
            {
             "$ref": "#/components/schemas/Decision"
            },
            {
             "type": "null"
            }
           ]
          },
          "open_decisions": {
           "type": "integer",
           "description": "Decisions that still need this visitor."
          },
          "approved_not_applied": {
           "type": "integer",
           "description": "Decisions approved and not yet shown applied by the platform."
          },
          "mode": {
           "$ref": "#/components/schemas/Mode"
          },
          "connections": {
           "type": "object",
           "properties": {
            "connected": {
             "type": "integer"
            },
            "total": {
             "type": "integer"
            }
           },
           "required": [
            "connected",
            "total"
           ]
          },
          "sample": {
           "anyOf": [
            {
             "type": "object",
             "properties": {
              "label": {
               "type": "string"
              },
              "note": {
               "type": "string"
              }
             },
             "required": [
              "label",
              "note"
             ]
            },
            {
             "type": "null"
            }
           ]
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          },
          "reconciliation": {
           "type": "object",
           "properties": {
            "window": {
             "type": "object",
             "properties": {
              "id": {
               "type": "string"
              },
              "label": {
               "type": "string"
              },
              "start": {
               "type": "string"
              },
              "end": {
               "type": "string"
              }
             },
             "required": [
              "id",
              "label",
              "start",
              "end"
             ]
            },
            "denominator": {
             "type": "string"
            },
            "decision_ids": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "total_usd": {
             "type": "number"
            },
            "left_out": {
             "type": "array",
             "items": {
              "type": "object"
             }
            },
            "proof_id": {
             "type": "string"
            },
            "duckdb": {
             "type": "object",
             "properties": {
              "pin": {
               "type": "string"
              },
              "read_set_digest": {
               "type": "string"
              },
              "tables": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "table": {
                  "type": "string"
                 },
                 "sha256": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string"
                 }
                },
                "required": [
                 "table",
                 "sha256"
                ]
               }
              },
              "script": {
               "type": "string"
              }
             },
             "required": [
              "pin",
              "read_set_digest",
              "tables",
              "script"
             ]
            }
           },
           "required": [
            "window",
            "denominator",
            "decision_ids",
            "total_usd",
            "left_out",
            "proof_id",
            "duckdb"
           ]
          }
         },
         "required": [
          "account",
          "period",
          "headline",
          "landed",
          "decision",
          "mode",
          "connections",
          "sample",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_overview"
   }
  },
  "/api/v1/decisions": {
   "get": {
    "operationId": "decisions",
    "summary": "Decisions",
    "description": "Every decision: the open ones first, then the ones with a result.",
    "tags": [
     "Decision"
    ],
    "parameters": [
     {
      "name": "seat",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "seat"
      },
      "description": "seat"
     },
     {
      "name": "line",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "line"
      },
      "description": "line"
     },
     {
      "name": "risk",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "risk"
      },
      "description": "risk"
     },
     {
      "name": "due",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "due"
      },
      "description": "due"
     },
     {
      "name": "owner",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "owner"
      },
      "description": "owner"
     },
     {
      "name": "applied",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "applied"
      },
      "description": "applied"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "cursor"
      },
      "description": "cursor"
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "open",
        "scored"
       ],
       "description": "Which decisions to list. Default all."
      },
      "description": "Which decisions to list. Default all."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "description": "How many, at most. Default 40.",
       "minimum": 1,
       "maximum": 100
      },
      "description": "How many, at most. Default 40."
     }
    ],
    "responses": {
     "200": {
      "description": "Every decision: the open ones first, then the ones with a result.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "decisions": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Decision"
           }
          },
          "counts": {
           "type": "object",
           "properties": {
            "open": {
             "type": "integer"
            },
            "scored": {
             "type": "integer"
            },
            "inside": {
             "type": "integer"
            },
            "outside": {
             "type": "integer"
            },
            "not_measurable": {
             "type": "integer"
            }
           },
           "required": [
            "open",
            "scored",
            "inside",
            "outside",
            "not_measurable"
           ]
          },
          "mode": {
           "$ref": "#/components/schemas/Mode"
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          },
          "total": {
           "type": "integer"
          },
          "next_cursor": {
           "anyOf": [
            {
             "type": "string"
            },
            {
             "type": "null"
            }
           ]
          }
         },
         "required": [
          "decisions",
          "counts",
          "mode",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_decisions"
   }
  },
  "/api/v1/decisions/{decision_id}": {
   "get": {
    "operationId": "decision",
    "summary": "One decision",
    "description": "What changes, what we expect, what it is compared with and what it costs, with each way it can go out.",
    "tags": [
     "Decision"
    ],
    "parameters": [
     {
      "name": "decision_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A decision's id, as in D-035.",
       "pattern": "^(?:D-[0-9]{3}|review-LI-[0-9]+-[A-Z]+)$"
      },
      "description": "A decision's id, as in D-035."
     },
     {
      "name": "action_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "What changes, what we expect, what it is compared with and what it costs, with each way it can go out.",
      "content": {
       "application/json": {
        "schema": {
         "anyOf": [
          {
           "type": "object",
           "properties": {
            "decision_id": {
             "type": "string"
            },
            "order_id": {
             "type": "string"
            },
            "line_item_id": {
             "type": "string"
            },
            "platform": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "title": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "state": {
             "type": "string"
            },
            "expected": {
             "anyOf": [
              {
               "$ref": "#/components/schemas/Figure"
              },
              {
               "type": "null"
              }
             ]
            },
            "result": {
             "anyOf": [
              {
               "$ref": "#/components/schemas/Figure"
              },
              {
               "type": "null"
              }
             ]
            },
            "known": {
             "type": "string",
             "description": "What was known when the decision was made."
            },
            "rows": {
             "type": "object",
             "properties": {
              "changes": {
               "type": "object",
               "properties": {
                "sentence": {
                 "type": "string"
                },
                "where": {
                 "type": "string"
                }
               },
               "required": [
                "sentence",
                "where"
               ]
              },
              "expect": {
               "type": "object",
               "properties": {
                "sentence": {
                 "type": "string"
                }
               },
               "required": [
                "sentence"
               ]
              },
              "compared_with": {
               "type": "object",
               "properties": {
                "sentence": {
                 "type": "string"
                },
                "held_line": {
                 "type": "string"
                },
                "risk_budget_pct": {
                 "type": "number"
                },
                "how_it_works": {
                 "type": "string"
                }
               },
               "required": [
                "sentence",
                "held_line",
                "risk_budget_pct",
                "how_it_works"
               ]
              },
              "costs": {
               "type": "object",
               "properties": {
                "sentence": {
                 "type": "string"
                }
               },
               "required": [
                "sentence"
               ]
              }
             },
             "required": [
              "changes",
              "expect",
              "compared_with",
              "costs"
             ]
            },
            "routes": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Route"
             },
             "description": "The ways this change can go out. Empty once the decision has its result."
            },
            "approval": {
             "$ref": "#/components/schemas/Approval"
            },
            "applied": {
             "$ref": "#/components/schemas/Applied"
            },
            "landed": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "order_check_id": {
             "anyOf": [
              {
               "type": "string",
               "description": "The check that holds today's query on this decision's order, when there is one."
              },
              {
               "type": "null"
              }
             ]
            },
            "mode": {
             "$ref": "#/components/schemas/Mode"
            },
            "source": {
             "$ref": "#/components/schemas/Source"
            },
            "provenance": {
             "$ref": "#/components/schemas/Provenance"
            },
            "diff": {
             "type": "object"
            },
            "current_seat": {
             "type": "object"
            },
            "rollback": {
             "type": "object"
            }
           },
           "required": [
            "decision_id",
            "order_id",
            "title",
            "status",
            "state",
            "known",
            "rows",
            "routes",
            "approval",
            "applied",
            "mode",
            "source",
            "provenance"
           ]
          },
          {
           "type": "object",
           "properties": {
            "decision_id": {
             "type": "string"
            },
            "review_only": {
             "const": true
            },
            "current_seat": {
             "type": "object"
            },
            "diff": {
             "type": "object"
            },
            "rollback": {
             "type": "object"
            }
           },
           "required": [
            "decision_id",
            "review_only",
            "current_seat",
            "diff",
            "rollback"
           ]
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_decision"
   }
  },
  "/api/v1/scorekeeper": {
   "get": {
    "operationId": "scorekeeper",
    "summary": "Scorekeeper",
    "description": "Forecast against result for every decision, with the ones that missed shown beside the ones that landed.",
    "tags": [
     "Scorekeeper"
    ],
    "parameters": [
     {
      "name": "action_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Forecast against result for every decision, with the ones that missed shown beside the ones that landed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "period": {
           "type": "object"
          },
          "total": {
           "$ref": "#/components/schemas/Figure"
          },
          "landed": {
           "type": "object",
           "properties": {
            "inside": {
             "type": "integer"
            },
            "scored": {
             "type": "integer"
            },
            "sentence": {
             "type": "string"
            }
           },
           "required": [
            "inside",
            "scored",
            "sentence"
           ]
          },
          "record": {
           "type": "object",
           "properties": {
            "scored": {
             "type": "integer"
            },
            "inside": {
             "type": "integer"
            },
            "outside": {
             "type": "integer"
            },
            "open": {
             "type": "integer"
            },
            "not_measurable": {
             "type": "integer"
            },
            "sentence": {
             "type": "string"
            }
           },
           "required": [
            "scored",
            "inside",
            "outside",
            "open",
            "not_measurable",
            "sentence"
           ]
          },
          "weeks": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "week_start": {
              "type": "string"
             },
             "inside": {
              "type": "integer"
             },
             "outside": {
              "type": "integer"
             },
             "open": {
              "type": "integer"
             },
             "not_measurable": {
              "type": "integer"
             }
            },
            "required": [
             "week_start",
             "inside",
             "outside",
             "open",
             "not_measurable"
            ]
           }
          },
          "forecasts": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Decision"
           }
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          },
          "reconciliation": {
           "type": "object",
           "properties": {
            "window": {
             "type": "object",
             "properties": {
              "id": {
               "type": "string"
              },
              "label": {
               "type": "string"
              },
              "start": {
               "type": "string"
              },
              "end": {
               "type": "string"
              }
             },
             "required": [
              "id",
              "label",
              "start",
              "end"
             ]
            },
            "denominator": {
             "type": "string"
            },
            "decision_ids": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "total_usd": {
             "type": "number"
            },
            "left_out": {
             "type": "array",
             "items": {
              "type": "object"
             }
            },
            "proof_id": {
             "type": "string"
            },
            "duckdb": {
             "type": "object",
             "properties": {
              "pin": {
               "type": "string"
              },
              "read_set_digest": {
               "type": "string"
              },
              "tables": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "table": {
                  "type": "string"
                 },
                 "sha256": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string"
                 }
                },
                "required": [
                 "table",
                 "sha256"
                ]
               }
              },
              "script": {
               "type": "string"
              }
             },
             "required": [
              "pin",
              "read_set_digest",
              "tables",
              "script"
             ]
            }
           },
           "required": [
            "window",
            "denominator",
            "decision_ids",
            "total_usd",
            "left_out",
            "proof_id",
            "duckdb"
           ]
          }
         },
         "required": [
          "period",
          "total",
          "landed",
          "record",
          "weeks",
          "forecasts",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_scorekeeper"
   }
  },
  "/api/v1/scorekeeper/money-map": {
   "get": {
    "operationId": "moneyMap",
    "summary": "The money map",
    "description": "What was paid and to whom: the open auction, private deals, guaranteed deals and data fees.",
    "tags": [
     "Scorekeeper"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "What was paid and to whom: the open auction, private deals, guaranteed deals and data fees.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "total": {
           "$ref": "#/components/schemas/Figure"
          },
          "parts": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "to": {
              "type": "string"
             },
             "paid": {
              "$ref": "#/components/schemas/Figure"
             },
             "share_pct": {
              "type": "number"
             },
             "view": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             }
            },
            "required": [
             "id",
             "label",
             "to",
             "paid",
             "share_pct",
             "view"
            ]
           }
          },
          "could_go": {
           "$ref": "#/components/schemas/Figure"
          },
          "data_vendors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "vendor": {
              "type": "string"
             },
             "segments": {
              "type": "integer"
             },
             "paid_usd": {
              "type": "number"
             },
             "cheaper_segment_would_cover_usd": {
              "type": "number"
             }
            },
            "required": [
             "vendor",
             "segments",
             "paid_usd",
             "cheaper_segment_would_cover_usd"
            ]
           }
          },
          "platforms": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "platform": {
              "type": "string"
             },
             "lines": {
              "type": "integer"
             },
             "media_usd": {
              "type": "number"
             }
            },
            "required": [
             "platform",
             "lines",
             "media_usd"
            ]
           }
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          },
          "reconciliation": {
           "type": "object",
           "properties": {
            "window": {
             "type": "object",
             "properties": {
              "id": {
               "type": "string"
              },
              "label": {
               "type": "string"
              },
              "start": {
               "type": "string"
              },
              "end": {
               "type": "string"
              }
             },
             "required": [
              "id",
              "label",
              "start",
              "end"
             ]
            },
            "denominator": {
             "type": "string"
            },
            "decision_ids": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "total_usd": {
             "type": "number"
            },
            "left_out": {
             "type": "array",
             "items": {
              "type": "object"
             }
            },
            "proof_id": {
             "type": "string"
            },
            "duckdb": {
             "type": "object",
             "properties": {
              "pin": {
               "type": "string"
              },
              "read_set_digest": {
               "type": "string"
              },
              "tables": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "table": {
                  "type": "string"
                 },
                 "sha256": {
                  "type": "string"
                 },
                 "url": {
                  "type": "string"
                 }
                },
                "required": [
                 "table",
                 "sha256"
                ]
               }
              },
              "script": {
               "type": "string"
              }
             },
             "required": [
              "pin",
              "read_set_digest",
              "tables",
              "script"
             ]
            }
           },
           "required": [
            "window",
            "denominator",
            "decision_ids",
            "total_usd",
            "left_out",
            "proof_id",
            "duckdb"
           ]
          }
         },
         "required": [
          "total",
          "parts",
          "could_go",
          "data_vendors",
          "platforms",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_money_map"
   }
  },
  "/api/v1/scorekeeper/deals": {
   "get": {
    "operationId": "deals",
    "summary": "Every deal",
    "description": "Every Deal ID in the book, ours and everyone else's: what it paid all-in, the fees that can be seen, and how it did against the line left as it was.",
    "tags": [
     "Scorekeeper"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Every Deal ID in the book, ours and everyone else's: what it paid all-in, the fees that can be seen, and how it did against the line left as it was.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "deals": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "deal_id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "kind": {
              "type": "string"
             },
             "run_by": {
              "type": "string"
             },
             "ours": {
              "type": "boolean"
             },
             "contract": {
              "type": "boolean",
              "description": "True when the deal is a contract commitment."
             },
             "platforms": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "paid": {
              "anyOf": [
               {
                "type": "object",
                "properties": {
                 "all_in_cpm": {
                  "$ref": "#/components/schemas/Figure"
                 },
                 "media_usd": {
                  "type": "number"
                 },
                 "data_fees_usd": {
                  "type": "number"
                 }
                },
                "required": [
                 "all_in_cpm",
                 "media_usd",
                 "data_fees_usd"
                ]
               },
               {
                "type": "null"
               }
              ]
             },
             "open_line": {
              "anyOf": [
               {
                "type": "object",
                "properties": {
                 "all_in_cpm": {
                  "type": "number"
                 },
                 "impressions": {
                  "type": "integer"
                 },
                 "pct_above": {
                  "type": "number"
                 },
                 "paid_above_usd": {
                  "$ref": "#/components/schemas/Figure"
                 },
                 "sentence": {
                  "type": "string"
                 }
                },
                "required": [
                 "all_in_cpm",
                 "impressions",
                 "pct_above",
                 "paid_above_usd",
                 "sentence"
                ]
               },
               {
                "type": "null"
               }
              ]
             },
             "fees": {
              "type": "array",
              "items": {
               "$ref": "#/components/schemas/FeeRow"
              }
             },
             "fees_disclosed": {
              "type": "boolean"
             },
             "break_even": {
              "anyOf": [
               {
                "type": "object",
                "properties": {
                 "pct": {
                  "type": "number"
                 },
                 "sentence": {
                  "type": "string"
                 }
                },
                "required": [
                 "pct",
                 "sentence"
                ]
               },
               {
                "type": "null"
               }
              ]
             },
             "result": {
              "type": "object",
              "properties": {
               "state": {
                "type": "string",
                "enum": [
                 "none"
                ]
               },
               "sentence": {
                "type": "string"
               }
              },
              "required": [
               "state",
               "sentence"
              ],
              "description": "The result against the current setup, after fees. None until a line is held against the deal."
             },
             "log_comparison": {
              "anyOf": [
               {
                "type": "object",
                "properties": {
                 "verdict": {
                  "type": "string",
                  "enum": [
                   "lost",
                   "beat",
                   "tied",
                   "insufficient_comparison"
                  ]
                 },
                 "words": {
                  "type": "string"
                 },
                 "sentence": {
                  "type": "string"
                 },
                 "deal_cost_per_purchase": {
                  "type": "number"
                 },
                 "open_cost_per_purchase": {
                  "type": "number"
                 },
                 "deal_purchases": {
                  "type": "integer"
                 },
                 "open_purchases": {
                  "type": "integer"
                 },
                 "scorer": {
                  "type": "object",
                  "description": "The deal scorer's own verdict on the campaign's logged impressions."
                 },
                 "source": {
                  "$ref": "#/components/schemas/Source"
                 }
                },
                "required": [
                 "verdict",
                 "words",
                 "sentence",
                 "source"
                ],
                "description": "A comparison read from the logs. No line was held, so it is not a proven result."
               },
               {
                "type": "null"
               }
              ]
             },
             "status": {
              "anyOf": [
               {
                "$ref": "#/components/schemas/DealStatus"
               },
               {
                "type": "null"
               }
              ]
             },
             "decisions": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            },
            "required": [
             "deal_id",
             "name",
             "kind",
             "run_by",
             "ours",
             "fees",
             "fees_disclosed",
             "break_even",
             "result",
             "log_comparison",
             "status",
             "decisions"
            ]
           }
          },
          "sentence": {
           "type": "string"
          },
          "source": {
           "$ref": "#/components/schemas/Source"
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "deals",
          "sentence",
          "source",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_deals"
   }
  },
  "/api/v1/authority": {
   "get": {
    "operationId": "authority",
    "summary": "How Precise can act",
    "description": "The mode, your stored rules, your spend limits and the one holdout number.",
    "tags": [
     "How Precise can act"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "The mode, your stored rules, your spend limits and the one holdout number.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AuthorityAnswer"
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_authority"
   }
  },
  "/api/v1/holdouts/{order_id}/sizing": {
   "get": {
    "operationId": "holdoutSizing",
    "summary": "Size a test",
    "description": "What a people-level test on one order can detect, by share held back and by days. Beside it, the holdout Precise runs on its own changes: two setups, both buying.",
    "tags": [
     "How Precise can act"
    ],
    "parameters": [
     {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "An order that carries a people-level test, as in ORD-012.",
       "pattern": "^ORD-[0-9]{3}$"
      },
      "description": "An order that carries a people-level test, as in ORD-012."
     }
    ],
    "responses": {
     "200": {
      "description": "What a people-level test on one order can detect, by share held back and by days. Beside it, the holdout Precise runs on its own changes: two setups, both buying.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "order_id": {
           "type": "string"
          },
          "orders": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "setup_holdout": {
           "type": "object",
           "properties": {
            "risk_budget_pct": {
             "type": "number"
            },
            "sentence": {
             "type": "string"
            },
            "how_it_works": {
             "type": "string"
            },
            "example": {
             "anyOf": [
              {
               "type": "object"
              },
              {
               "type": "null"
              }
             ]
            }
           },
           "required": [
            "risk_budget_pct",
            "sentence",
            "how_it_works",
            "example"
           ]
          },
          "unit_holdout": {
           "type": "object",
           "properties": {
            "verdict": {
             "type": "string"
            },
            "reading": {
             "type": "string"
            },
            "target_lift": {
             "type": "number"
            },
            "basis": {
             "type": "object"
            },
            "recommended": {
             "anyOf": [
              {
               "type": "object"
              },
              {
               "type": "null"
              }
             ]
            },
            "best_available": {
             "anyOf": [
              {
               "type": "object"
              },
              {
               "type": "null"
              }
             ]
            },
            "units_needed_per_arm": {
             "anyOf": [
              {
               "type": "number"
              },
              {
               "type": "null"
              }
             ]
            },
            "frontier": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "duration_days": {
                "type": "integer"
               },
               "min_holdout_pct": {
                "anyOf": [
                 {
                  "type": "number"
                 },
                 {
                  "type": "null"
                 }
                ]
               },
               "mde_at_min_holdout": {
                "anyOf": [
                 {
                  "type": "number"
                 },
                 {
                  "type": "null"
                 }
                ]
               },
               "mde_at_max_holdout": {
                "anyOf": [
                 {
                  "type": "number"
                 },
                 {
                  "type": "null"
                 }
                ]
               }
              },
              "required": [
               "duration_days"
              ]
             }
            },
            "source": {
             "$ref": "#/components/schemas/Source"
            }
           },
           "required": [
            "verdict",
            "reading",
            "target_lift",
            "basis",
            "recommended",
            "best_available",
            "units_needed_per_arm",
            "frontier",
            "source"
           ]
          },
          "kinds": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "meaning": {
              "type": "string"
             }
            },
            "required": [
             "id",
             "label",
             "meaning"
            ]
           }
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "order_id",
          "orders",
          "setup_holdout",
          "unit_holdout",
          "kinds",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "size_holdout"
   }
  },
  "/api/v1/governance/plan": {
   "get": {
    "operationId": "spendPlan",
    "summary": "Spend limits",
    "description": "The spend plan in plain words: the limit, what is committed, what is left and who may be paid.",
    "tags": [
     "How Precise can act"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "The spend plan in plain words: the limit, what is committed, what is left and who may be paid.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "plan_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "currency": {
           "type": "string"
          },
          "cap": {
           "type": "number"
          },
          "committed": {
           "type": "number"
          },
          "set_aside": {
           "type": "number"
          },
          "remaining": {
           "type": "number"
          },
          "flight": {
           "type": "object"
          },
          "approved_sellers": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "sentence": {
           "type": "string"
          },
          "offers": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "offer_id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "seller": {
              "type": "string"
             },
             "amount": {
              "type": "number"
             },
             "currency": {
              "type": "string"
             }
            },
            "required": [
             "offer_id",
             "label",
             "seller",
             "amount",
             "currency"
            ]
           }
          },
          "signing_key": {
           "type": "object",
           "description": "The public key that signs this server's approvals."
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "plan_id",
          "name",
          "currency",
          "cap",
          "committed",
          "set_aside",
          "remaining",
          "flight",
          "approved_sellers",
          "sentence",
          "offers",
          "signing_key",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_spend_plan"
   }
  },
  "/api/v1/connections": {
   "get": {
    "operationId": "connections",
    "summary": "Connections",
    "description": "Your data, buying platforms, supply partners, a partner's data and agents: connected or not, and what each one unlocks.",
    "tags": [
     "Connections"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Your data, buying platforms, supply partners, a partner's data and agents: connected or not, and what each one unlocks.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "connected": {
           "type": "integer"
          },
          "total": {
           "type": "integer"
          },
          "groups": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "rows": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "id": {
                 "type": "string"
                },
                "name": {
                 "type": "string"
                },
                "detail": {
                 "anyOf": [
                  {
                   "type": "string"
                  },
                  {
                   "type": "null"
                  }
                 ]
                },
                "connected": {
                 "type": "boolean"
                },
                "unlocks": {
                 "type": "string"
                },
                "action": {
                 "anyOf": [
                  {
                   "type": "object",
                   "properties": {
                    "label": {
                     "type": "string"
                    },
                    "view": {
                     "type": "string"
                    },
                    "params": {
                     "type": "object"
                    }
                   },
                   "required": [
                    "label",
                    "view",
                    "params"
                   ]
                  },
                  {
                   "type": "null"
                  }
                 ]
                }
               },
               "required": [
                "id",
                "name",
                "connected",
                "unlocks"
               ]
              }
             }
            },
            "required": [
             "id",
             "label",
             "rows"
            ]
           }
          },
          "agent_snippet": {
           "type": "string",
           "description": "The configuration that connects an agent to this server."
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "connected",
          "total",
          "groups",
          "agent_snippet",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_connections"
   }
  },
  "/api/v1/clouds/{cloud}/probe": {
   "get": {
    "operationId": "cloudProbe",
    "summary": "See what Precise can read",
    "description": "For one cloud: the tables and columns Precise is granted, where its snapshot is written, the grant to paste and the one statement it runs. The rows stay in your cloud.",
    "tags": [
     "Connections"
    ],
    "parameters": [
     {
      "name": "cloud",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "aws",
        "gcp",
        "snowflake",
        "databricks"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "For one cloud: the tables and columns Precise is granted, where its snapshot is written, the grant to paste and the one statement it runs. The rows stay in your cloud.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "cloud": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "warehouse": {
           "type": "string"
          },
          "connected": {
           "type": "boolean"
          },
          "tenant": {
           "type": "string"
          },
          "can_read": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "table": {
              "type": "string"
             },
             "columns": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            },
            "required": [
             "table",
             "columns"
            ]
           }
          },
          "runs_as": {
           "type": "string"
          },
          "compute": {
           "type": "string"
          },
          "writes_to": {
           "type": "string"
          },
          "rows_leave_your_cloud": {
           "type": "boolean"
          },
          "grant": {
           "type": "object",
           "description": "The grant, as the renderer writes it for this cloud."
          },
          "grant_text": {
           "type": "string",
           "description": "The grant as text to paste."
          },
          "statement": {
           "type": "object",
           "properties": {
            "sql": {
             "type": "string"
            },
            "target": {},
            "grant_digest": {
             "type": "string"
            }
           },
           "required": [
            "sql",
            "grant_digest"
           ]
          },
          "checks": {
           "type": "object",
           "properties": {
            "ran": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "asked": {
                "type": "string"
               },
               "statement": {
                "type": "string"
               }
              },
              "required": [
               "asked",
               "statement"
              ]
             }
            },
            "turned_away": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "asked": {
                "type": "string"
               },
               "said": {
                "type": "string"
               }
              },
              "required": [
               "asked",
               "said"
              ]
             }
            }
           },
           "required": [
            "ran",
            "turned_away"
           ]
          },
          "snapshot": {
           "type": "object",
           "properties": {
            "door": {
             "type": "string"
            },
            "doors": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           },
           "required": [
            "door",
            "doors"
           ]
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "cloud",
          "name",
          "warehouse",
          "connected",
          "tenant",
          "can_read",
          "runs_as",
          "compute",
          "writes_to",
          "rows_leave_your_cloud",
          "grant",
          "grant_text",
          "statement",
          "checks",
          "snapshot",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "see_what_precise_can_read"
   }
  },
  "/api/v1/cleanroom/partners": {
   "get": {
    "operationId": "roomPartners",
    "summary": "Add a partner's data: the tables",
    "description": "The two tables that can meet, what they are matched on, and the questions that can be asked of them.",
    "tags": [
     "Connections"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "The two tables that can meet, what they are matched on, and the questions that can be asked of them.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tables": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "side": {
              "type": "string"
             },
             "owner": {
              "type": "string"
             },
             "table": {
              "type": "string"
             },
             "rows_rounded": {
              "type": "integer"
             },
             "matched_on": {
              "type": "string"
             },
             "filled_pct": {
              "type": "number"
             },
             "counts": {
              "type": "string"
             },
             "smallest_group": {
              "type": "integer"
             },
             "snapshot_digest": {
              "type": "string"
             }
            },
            "required": [
             "side",
             "owner",
             "table",
             "rows_rounded",
             "matched_on",
             "filled_pct",
             "counts",
             "smallest_group",
             "snapshot_digest"
            ]
           }
          },
          "questions": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             }
            },
            "required": [
             "id",
             "label"
            ]
           }
          },
          "protections": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "default": {
              "type": "boolean"
             }
            },
            "required": [
             "id",
             "label",
             "default"
            ]
           }
          },
          "runs_live": {
           "type": "boolean"
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "tables",
          "questions",
          "protections",
          "runs_live",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_partner_tables"
   }
  },
  "/api/v1/cleanroom/preflight": {
   "post": {
    "operationId": "roomPreflight",
    "summary": "Add a partner's data: do the match formats agree",
    "description": "Before any row is read, both sides prepare five test email addresses. If they come out the same, the match formats agree. If not, the answer says what to fix.",
    "tags": [
     "Connections"
    ],
    "parameters": [],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "scenario": {
          "type": "string",
          "enum": [
           "match",
           "mismatch"
          ],
          "description": "match: the two sides agree. mismatch: the partner's side keeps the dots in Gmail addresses."
         }
        },
        "required": []
       },
       "example": {
        "scenario": "match"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Before any row is read, both sides prepare five test email addresses. If they come out the same, the match formats agree. If not, the answer says what to fix.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "scenario": {
           "type": "string"
          },
          "match_formats_agree": {
           "type": "boolean"
          },
          "sentence": {
           "type": "string"
          },
          "ready": {
           "type": "boolean"
          },
          "rows_read": {
           "type": "integer"
          },
          "checks": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "ok": {
              "type": "boolean"
             },
             "title": {
              "type": "string"
             },
             "detail": {
              "type": "string"
             }
            },
            "required": [
             "ok",
             "title",
             "detail"
            ]
           }
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "scenario",
          "match_formats_agree",
          "sentence",
          "ready",
          "rows_read",
          "checks",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "check_match_formats"
   }
  },
  "/api/v1/cleanroom/run": {
   "post": {
    "operationId": "roomRun",
    "summary": "Add a partner's data: the result",
    "description": "Run the match in a sealed job both sides approved. Exact counts with a minimum group size is the default; noise is one option. The answer comes with a proof file.",
    "tags": [
     "Connections"
    ],
    "parameters": [],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "operation": {
          "type": "string",
          "enum": [
           "overlap_count",
           "group_lift",
           "adcp_segment_activation"
          ],
          "description": "overlap_count: how many people are in both tables. group_lift: result against the current setup. adcp_segment_activation: an audience a seller can target."
         },
         "privacy": {
          "type": "string",
          "enum": [
           "strict_floor",
           "geometric_dp"
          ],
          "description": "strict_floor: exact, with a minimum group size. geometric_dp: with noise added."
         },
         "scenario": {
          "type": "string",
          "enum": [
           "match",
           "mismatch"
          ]
         }
        },
        "required": []
       },
       "example": {
        "operation": "overlap_count",
        "privacy": "strict_floor"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Run the match in a sealed job both sides approved. Exact counts with a minimum group size is the default; noise is one option. The answer comes with a proof file.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "operation": {
           "type": "string"
          },
          "privacy": {
           "type": "string"
          },
          "result": {
           "type": "object"
          },
          "sentence": {
           "type": "string"
          },
          "both_sides_approved": {
           "type": "boolean"
          },
          "approvals": {
           "type": "object",
           "properties": {
            "organizations": {
             "type": "integer"
            },
            "passkeys": {
             "type": "integer"
            }
           },
           "required": [
            "organizations",
            "passkeys"
           ]
          },
          "match_formats_agree": {
           "type": "boolean"
          },
          "smallest_group": {
           "type": "integer"
          },
          "sealed_by": {
           "type": "string"
          },
          "note": {
           "anyOf": [
            {
             "type": "string"
            },
            {
             "type": "null"
            }
           ]
          },
          "verification": {
           "type": "object",
           "properties": {
            "ok": {
             "type": "boolean"
            },
            "level": {
             "type": "string"
            },
            "checks": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Check"
             }
            }
           },
           "required": [
            "ok",
            "level",
            "checks"
           ]
          },
          "audience": {
           "type": "object",
           "properties": {
            "segment_id": {
             "type": "string"
            },
            "size": {
             "anyOf": [
              {
               "type": "number"
              },
              {
               "type": "null"
              }
             ]
            },
            "goes_to": {
             "type": "string"
            },
            "expires_at": {
             "type": "string"
            }
           },
           "required": [
            "segment_id",
            "size",
            "goes_to",
            "expires_at"
           ]
          },
          "source": {
           "$ref": "#/components/schemas/Source"
          },
          "proof_id": {
           "type": "string"
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "operation",
          "privacy",
          "result",
          "sentence",
          "both_sides_approved",
          "match_formats_agree",
          "verification",
          "source",
          "proof_id",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "It cannot be done in the present state.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "run_partner_match"
   }
  },
  "/api/v1/checks/sql": {
   "get": {
    "operationId": "sqlChecks",
    "summary": "The queries behind the numbers",
    "description": "Every query a number on a screen came from.",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Every query a number on a screen came from.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "checks": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "check_id": {
              "type": "string"
             },
             "title": {
              "type": "string"
             },
             "rows": {
              "type": "integer"
             }
            },
            "required": [
             "check_id",
             "title",
             "rows"
            ]
           }
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "checks",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_sql_checks"
   }
  },
  "/api/v1/checks/sql/{check_id}": {
   "get": {
    "operationId": "sqlCheck",
    "summary": "One query, its rows, and how to rerun it",
    "description": "The SQL behind a number, the rows it returned, the tables it read, and a DuckDB script that reruns it on the same files.",
    "tags": [
     "Expert"
    ],
    "parameters": [
     {
      "name": "check_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A check's id, as in deals-against-open or ORD-044.",
       "pattern": "^[A-Za-z0-9-]{1,60}$"
      },
      "description": "A check's id, as in deals-against-open or ORD-044."
     }
    ],
    "responses": {
     "200": {
      "description": "The SQL behind a number, the rows it returned, the tables it read, and a DuckDB script that reruns it on the same files.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "check_id": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "sql": {
           "type": "string"
          },
          "columns": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "rows": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "rows_kept": {
           "type": "boolean"
          },
          "total_rows": {
           "type": "integer"
          },
          "source": {
           "$ref": "#/components/schemas/Source"
          },
          "duckdb": {
           "type": "object",
           "properties": {
            "pin": {
             "type": "string"
            },
            "read_set_digest": {
             "type": "string"
            },
            "tables": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "table": {
                "type": "string"
               },
               "sha256": {
                "type": "string"
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "table",
               "sha256"
              ]
             }
            },
            "script": {
             "type": "string"
            }
           },
           "required": [
            "pin",
            "read_set_digest",
            "tables",
            "script"
           ]
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "check_id",
          "title",
          "sql",
          "columns",
          "rows",
          "rows_kept",
          "total_rows",
          "source",
          "duckdb",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_sql_check"
   }
  },
  "/api/v1/activation/targets": {
   "get": {
    "operationId": "dspTargets",
    "summary": "What each buying platform receives",
    "description": "The compiled buying rules, one bid under them, and the form a change takes in Beeswax, The Trade Desk, DV360 and Amazon DSP.",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "The compiled buying rules, one bid under them, and the form a change takes in Beeswax, The Trade Desk, DV360 and Amazon DSP.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "policy": {
           "type": "object"
          },
          "bid": {
           "type": "object"
          },
          "targets": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "platform": {
              "type": "string"
             },
             "receives": {
              "type": "string"
             }
            },
            "required": [
             "platform",
             "receives"
            ]
           }
          },
          "applied_rule": {
           "type": "string"
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "policy",
          "bid",
          "targets",
          "applied_rule",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_platform_targets"
   }
  },
  "/api/v1/execution/simulate": {
   "post": {
    "operationId": "simulateExecution",
    "summary": "One auction, traced",
    "description": "What the container proposed on one auction (ARTF 1.0), and what the exchange's host applied. A proposal the host did not apply counts for nothing.",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "host": {
          "type": "string",
          "enum": [
           "accept",
           "reject"
          ],
          "description": "accept: the host applied what was proposed. reject: it did not."
         }
        },
        "required": []
       },
       "example": {
        "host": "reject"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "What the container proposed on one auction (ARTF 1.0), and what the exchange's host applied. A proposal the host did not apply counts for nothing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "mode": {
           "$ref": "#/components/schemas/Mode"
          },
          "host": {
           "type": "string"
          },
          "granted_intents": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "model": {
           "anyOf": [
            {
             "type": "string"
            },
            {
             "type": "null"
            }
           ]
          },
          "mutations": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "intent": {
              "type": "string"
             },
             "path": {
              "type": "string"
             },
             "request": {
              "type": "string"
             },
             "proposed_cpm": {
              "anyOf": [
               {
                "type": "number"
               },
               {
                "type": "null"
               }
              ]
             },
             "before_cpm": {
              "anyOf": [
               {
                "type": "number"
               },
               {
                "type": "null"
               }
              ]
             },
             "after_cpm": {
              "anyOf": [
               {
                "type": "number"
               },
               {
                "type": "null"
               }
              ]
             },
             "applied_by_host": {
              "type": "boolean"
             }
            },
            "required": [
             "intent",
             "path",
             "request",
             "proposed_cpm",
             "before_cpm",
             "after_cpm",
             "applied_by_host"
            ]
           }
          },
          "exposure": {
           "type": "object",
           "properties": {
            "counted": {
             "type": "boolean"
            },
            "attributed_micros": {
             "type": "number"
            },
            "paid_micros": {
             "type": "number"
            },
            "bid_cpm_before": {
             "type": "number"
            },
            "bid_cpm_after": {
             "type": "number"
            },
            "saved_cpm": {
             "type": "number"
            },
            "sentence": {
             "type": "string"
            }
           },
           "required": [
            "counted",
            "attributed_micros",
            "paid_micros",
            "bid_cpm_before",
            "bid_cpm_after",
            "saved_cpm",
            "sentence"
           ]
          },
          "latency": {
           "type": "object",
           "description": "The whole-call latency as measured, with the conditions it was measured under."
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "mode",
          "host",
          "granted_intents",
          "model",
          "mutations",
          "exposure",
          "latency",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "trace_auction"
   }
  },
  "/api/v1/proofs": {
   "get": {
    "operationId": "proofs",
    "summary": "Proof files",
    "description": "Every proof file this workspace can download.",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Every proof file this workspace can download.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "proofs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "proof_id": {
              "type": "string"
             },
             "kind": {
              "type": "string"
             },
             "title": {
              "type": "string"
             },
             "issued_at": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             }
            },
            "required": [
             "proof_id",
             "kind",
             "title",
             "issued_at"
            ]
           }
          },
          "signing_key": {
           "type": "object"
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "proofs",
          "signing_key",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_proof_files"
   }
  },
  "/api/v1/proofs/{proof_id}": {
   "get": {
    "operationId": "proof",
    "summary": "Download a proof file",
    "description": "One proof file: what it is about, the content, and a signature. It can be checked with no network.",
    "tags": [
     "Expert"
    ],
    "parameters": [
     {
      "name": "proof_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A proof file's id.",
       "pattern": "^[A-Za-z0-9_.-]{1,120}$"
      },
      "description": "A proof file's id."
     }
    ],
    "responses": {
     "200": {
      "description": "One proof file: what it is about, the content, and a signature. It can be checked with no network.",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object",
           "properties": {
            "schema": {
             "type": "string"
            },
            "title": {
             "type": "string"
            },
            "subject": {
             "type": "object",
             "properties": {
              "kind": {
               "type": "string"
              },
              "id": {
               "type": "string"
              },
              "content_digest": {
               "type": "string"
              },
              "digest_profile": {
               "type": "string"
              },
              "issued_at": {
               "type": "string"
              },
              "sample": {
               "type": "boolean"
              }
             },
             "required": [
              "kind",
              "id",
              "content_digest",
              "digest_profile",
              "issued_at",
              "sample"
             ]
            },
            "content": {
             "type": "object"
            },
            "signed_by": {
             "type": "object"
            },
            "signature": {
             "type": "string"
            },
            "anchors": {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           },
           "required": [
            "schema",
            "title",
            "subject",
            "content",
            "signed_by",
            "signature",
            "anchors"
           ]
          },
          {
           "type": "object",
           "properties": {
            "schema": {
             "const": "precise.proof/v1"
            },
            "profile": {
             "const": "dispatch-v1"
            },
            "leaf": {
             "type": "object"
            },
            "subject": {
             "type": "object"
            },
            "statement": {
             "type": "object"
            },
            "signature": {
             "type": "string"
            },
            "evidence": {
             "type": "object"
            }
           },
           "required": [
            "schema",
            "profile",
            "leaf",
            "subject",
            "statement",
            "signature",
            "evidence"
           ]
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_proof_file"
   }
  },
  "/api/v1/proof/verify": {
   "post": {
    "operationId": "verifyProof",
    "summary": "Check a proof file",
    "description": "Check a file with no network. The answer is what was checked here, never what the file claims. A file changed by one byte is not verified.",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "object",
          "description": "A proof file's JSON."
         },
         "proof": {
          "type": "object",
          "description": "A clean-room proof on its own."
         },
         "pki_root_pem": {
          "type": "string",
          "description": "With `proof`: the root of the authority that sealed it."
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Check a file with no network. The answer is what was checked here, never what the file claims. A file changed by one byte is not verified.",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object",
           "properties": {
            "ok": {
             "type": "boolean"
            },
            "kind": {
             "type": "string"
            },
            "level": {
             "type": "string",
             "enum": [
              "unverified",
              "signed_local",
              "merkle_local",
              "chain_anchored"
             ]
            },
            "words": {
             "type": "string",
             "description": "Signed, Checked against Ethereum, Pending, or Not verified."
            },
            "pending": {
             "type": "boolean"
            },
            "notes": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "description": "What a reader should know beside the verdict, such as a job sealed by a test authority."
            },
            "checks": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Check"
             }
            },
            "subject": {
             "anyOf": [
              {
               "type": "object"
              },
              {
               "type": "null"
              }
             ]
            },
            "digest": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "provenance": {
             "$ref": "#/components/schemas/Provenance"
            }
           },
           "required": [
            "ok",
            "kind",
            "level",
            "words",
            "pending",
            "notes",
            "checks",
            "subject",
            "digest",
            "provenance"
           ]
          },
          {
           "type": "object",
           "properties": {
            "tier": {
             "type": "string"
            },
            "checks": {
             "type": "object"
            },
            "current_authority": {
             "type": "string"
            }
           },
           "required": [
            "tier",
            "checks",
            "current_authority"
           ]
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "verify_proof_file"
   }
  },
  "/api/v1/ask": {
   "post": {
    "operationId": "ask",
    "summary": "Ask Precise",
    "description": "Ask about an order, a deal, a fee, a result or a limit. Each answer is a sentence from one of the screens, and where to open it.",
    "tags": [
     "Home"
    ],
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "question": {
          "type": "string",
          "description": "The question, in plain words.",
          "minLength": 1,
          "maxLength": 300
         }
        },
        "required": [
         "question"
        ]
       },
       "example": {
        "question": "Which deal lost to the open line?"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Ask about an order, a deal, a fee, a result or a limit. Each answer is a sentence from one of the screens, and where to open it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "question": {
           "type": "string"
          },
          "understood": {
           "type": "boolean"
          },
          "answers": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "title": {
              "type": "string"
             },
             "sentence": {
              "type": "string"
             },
             "view": {
              "type": "string"
             },
             "params": {
              "type": "object"
             }
            },
            "required": [
             "title",
             "sentence",
             "view",
             "params"
            ]
           }
          },
          "try": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "provenance": {
           "$ref": "#/components/schemas/Provenance"
          }
         },
         "required": [
          "question",
          "understood",
          "answers",
          "try",
          "provenance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "ask"
   }
  },
  "/api/v1/runtime": {
   "get": {
    "operationId": "runtime",
    "summary": "What this server is running on",
    "description": "Sample data, recorded data or a live connection, and the tools behind each recorded answer.",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Sample data, recorded data or a live connection, and the tools behind each recorded answer.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "runtime_mode": {
           "type": "string",
           "enum": [
            "public_test",
            "recorded_replay",
            "live"
           ]
          },
          "sample": {
           "anyOf": [
            {
             "type": "object",
             "properties": {
              "label": {
               "type": "string"
              },
              "note": {
               "type": "string"
              }
             },
             "required": [
              "label",
              "note"
             ]
            },
            {
             "type": "null"
            }
           ]
          },
          "connected": {
           "type": "boolean"
          },
          "engines": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "signing_key": {
           "anyOf": [
            {
             "type": "object"
            },
            {
             "type": "null"
            }
           ]
          },
          "source": {
           "type": "string"
          },
          "profile": {
           "type": "string",
           "enum": [
            "public_test",
            "tenant_read",
            "spend_capable"
           ]
          },
          "proof_policy": {
           "type": "object"
          }
         },
         "required": [
          "runtime_mode",
          "sample",
          "connected"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_runtime"
   }
  },
  "/api/v1/operations": {
   "get": {
    "operationId": "operations",
    "summary": "This API",
    "description": "Every operation, by screen, each with the exact curl, MCP call and Python that runs it. With `id` and `values`, the call for one operation as a screen made it.",
    "tags": [
     "Expert"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "One operation's id, to get just that one.",
       "pattern": "^[A-Za-z_]{1,64}$"
      },
      "description": "One operation's id, to get just that one."
     },
     {
      "name": "values",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "With `id`: the values the call was made with, as JSON: {\"params\": {...}, \"body\": {...}}.",
       "maxLength": 4000
      },
      "description": "With `id`: the values the call was made with, as JSON: {\"params\": {...}, \"body\": {...}}."
     }
    ],
    "responses": {
     "200": {
      "description": "Every operation, by screen, each with the exact curl, MCP call and Python that runs it. With `id` and `values`, the call for one operation as a screen made it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "screens": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "sentence": {
              "type": "string"
             }
            },
            "required": [
             "id",
             "label",
             "sentence"
            ]
           }
          },
          "operations": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "method": {
              "type": "string"
             },
             "path": {
              "type": "string"
             },
             "tool": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "screen": {
              "type": "string"
             },
             "title": {
              "type": "string"
             },
             "summary": {
              "type": "string"
             },
             "snippets": {
              "type": "object",
              "properties": {
               "curl": {
                "type": "string"
               },
               "mcp": {
                "anyOf": [
                 {
                  "type": "string"
                 },
                 {
                  "type": "null"
                 }
                ]
               },
               "python": {
                "type": "string"
               }
              },
              "required": [
               "curl",
               "mcp",
               "python"
              ]
             }
            },
            "required": [
             "id",
             "method",
             "path",
             "tool",
             "screen",
             "title",
             "summary",
             "snippets"
            ]
           }
          }
         },
         "required": [
          "screens",
          "operations"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_operations"
   }
  },
  "/api/v1/connections/public-book": {
   "get": {
    "operationId": "publicConnection",
    "summary": "Inspect the published book and immutable table pins",
    "description": "Inspect the published book and immutable table pins",
    "tags": [
     "Expert"
    ],
    "parameters": [
     {
      "name": "connection_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Inspect the published book and immutable table pins",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "connection_id": {
           "type": "string"
          },
          "pin": {
           "type": "string"
          },
          "tenant_source": {
           "type": "string"
          },
          "window": {
           "type": "object"
          },
          "tables": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "table": {
              "type": "string"
             },
             "sha256": {
              "type": "string"
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "table",
             "sha256"
            ]
           }
          }
         },
         "required": [
          "connection_id",
          "pin",
          "tenant_source",
          "window",
          "tables"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "connect_public_book"
   }
  },
  "/api/v1/pins/{pin}": {
   "get": {
    "operationId": "snapshot",
    "summary": "Inspect a pinned snapshot",
    "description": "Inspect a pinned snapshot",
    "tags": [
     "Expert"
    ],
    "parameters": [
     {
      "name": "pin",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "pin"
      },
      "description": "pin"
     }
    ],
    "responses": {
     "200": {
      "description": "Inspect a pinned snapshot",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "connection_id": {
           "type": "string"
          },
          "pin": {
           "type": "string"
          },
          "tenant_source": {
           "type": "string"
          },
          "window": {
           "type": "object"
          },
          "tables": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "table": {
              "type": "string"
             },
             "sha256": {
              "type": "string"
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "table",
             "sha256"
            ]
           }
          }
         },
         "required": [
          "connection_id",
          "pin",
          "tenant_source",
          "window",
          "tables"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "inspect_snapshot"
   }
  },
  "/api/v1/query": {
   "post": {
    "operationId": "query",
    "summary": "Execute read-only SQL on a pinned book",
    "description": "Execute read-only SQL on a pinned book",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "sql": {
          "type": "string"
         },
         "pin": {
          "type": "string"
         },
         "max_rows": {
          "type": "integer"
         },
         "decision_id": {
          "type": "string"
         }
        },
        "required": [
         "sql",
         "pin"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Execute read-only SQL on a pinned book",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "connection_id": {
           "type": "string"
          },
          "pin": {
           "type": "string"
          },
          "run_id": {
           "type": "string"
          },
          "catalog_digest": {
           "type": "string"
          },
          "result_digest": {
           "type": "string"
          },
          "rows": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "columns": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "logical_read_set": {
           "type": "object",
           "properties": {
            "pin": {
             "type": "string"
            },
            "read_set_digest": {
             "type": "string"
            },
            "tables": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "table": {
                "type": "string"
               },
               "sha256": {
                "type": "string"
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "table",
               "sha256"
              ]
             }
            }
           },
           "required": [
            "pin",
            "read_set_digest",
            "tables"
           ]
          },
          "duckdb": {
           "type": "object",
           "properties": {
            "pin": {
             "type": "string"
            },
            "read_set_digest": {
             "type": "string"
            },
            "tables": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "table": {
                "type": "string"
               },
               "sha256": {
                "type": "string"
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "table",
               "sha256"
              ]
             }
            },
            "script": {
             "type": "string"
            }
           },
           "required": [
            "pin",
            "read_set_digest",
            "tables",
            "script"
           ]
          }
         },
         "required": [
          "connection_id",
          "pin",
          "run_id",
          "catalog_digest",
          "result_digest",
          "rows",
          "columns",
          "logical_read_set",
          "duckdb"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "query_pinned_book"
   }
  },
  "/api/v1/runs/{run_id}": {
   "get": {
    "operationId": "runRows",
    "summary": "Reopen a run and its visualization rows",
    "description": "Reopen a run and its visualization rows",
    "tags": [
     "Expert"
    ],
    "parameters": [
     {
      "name": "run_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "run_id"
      },
      "description": "run_id"
     }
    ],
    "responses": {
     "200": {
      "description": "Reopen a run and its visualization rows",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "open_run_rows"
   }
  },
  "/api/v1/size": {
   "post": {
    "operationId": "sizePinned",
    "summary": "Check holdout integrity and size the order",
    "description": "Check holdout integrity and size the order",
    "tags": [
     "Expert"
    ],
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "run_id": {
          "type": "string"
         },
         "decision_id": {
          "type": "string"
         }
        },
        "required": [
         "run_id",
         "decision_id"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Check holdout integrity and size the order",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "query_run_id": {
           "type": "string"
          },
          "sizing_run_id": {
           "type": "string"
          },
          "decision_id": {
           "type": "string"
          },
          "order_id": {
           "type": "string"
          },
          "pin": {
           "type": "string"
          },
          "verdict": {
           "type": "string"
          }
         },
         "required": [
          "query_run_id",
          "sizing_run_id",
          "decision_id",
          "order_id",
          "pin",
          "verdict"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-mcp-tool": "size_pinned_holdout"
   }
  },
  "/api/v1/events": {
   "get": {
    "operationId": "events",
    "summary": "Events",
    "description": "Server-sent events: tenant-scoped changes after a cursor. Resume with Last-Event-ID or after.",
    "tags": [
     "Expert"
    ],
    "responses": {
     "200": {
      "description": "A stream of events: run, figure, guide, approval, proof.",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/tools/get_guide": {
   "post": {
    "operationId": "get_guide",
    "summary": "The guide in force for this account: its terms, its rules and how its figures are computed. Start here.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "version": {
          "type": "integer",
          "description": "An earlier version. Leave out for the one in force."
         }
        },
        "required": [],
        "additionalProperties": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Read the guide"
     }
    }
   }
  },
  "/api/v1/tools/get_figures": {
   "post": {
    "operationId": "get_figures",
    "summary": "Figures already computed for this account, newest first. Each names the run or the call it rests on.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "subject_kind": {
          "type": "string",
          "enum": [
           "run",
           "call"
          ]
         },
         "subject_id": {
          "type": "string",
          "description": "Only figures that rest on this run or call."
         },
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200
         }
        },
        "required": [],
        "additionalProperties": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Read figures"
     }
    }
   }
  },
  "/api/v1/tools/inspect_audit": {
   "post": {
    "operationId": "inspect_audit",
    "summary": "One run: its method, its input and result digests, the runs it was computed from, and the figures that rest on it.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "run_id": {
          "type": "string",
          "description": "The run to inspect."
         }
        },
        "required": [
         "run_id"
        ],
        "additionalProperties": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Inspect a run"
     }
    }
   }
  },
  "/api/v1/tools/get_changes": {
   "post": {
    "operationId": "get_changes",
    "summary": "Runs, figures and guides written since a cursor, oldest first. Pass the returned cursor to read on from there.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "after": {
          "type": "string",
          "description": "The cursor to read after. Leave out to read from the start."
         },
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
         }
        },
        "required": [],
        "additionalProperties": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Read what changed"
     }
    }
   }
  },
  "/api/v1/tools/ratio_shapley": {
   "post": {
    "operationId": "ratio_shapley",
    "summary": "Use the native exact ratio solver or the bounded antithetic estimator when a floor binds.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "segments": {
          "type": "array",
          "minItems": 1,
          "maxItems": 500,
          "items": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string",
             "minLength": 1,
             "maxLength": 128
            },
            "num": {
             "type": "number"
            },
            "den": {
             "type": "number",
             "minimum": 0
            }
           },
           "required": [
            "name",
            "num",
            "den"
           ],
           "additionalProperties": false
          }
         },
         "floor": {
          "type": "number",
          "exclusiveMinimum": 0
         }
        },
        "required": [
         "segments"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Attribute a ratio to aggregate segments"
     }
    }
   }
  },
  "/api/v1/connections/{connection_id}": {
   "get": {
    "operationId": "reopenConnection",
    "parameters": [
     {
      "in": "path",
      "name": "connection_id",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Inspect the published book and immutable table pins",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "connection_id": {
           "type": "string"
          },
          "pin": {
           "type": "string"
          },
          "tenant_source": {
           "type": "string"
          },
          "window": {
           "type": "object"
          },
          "tables": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "table": {
              "type": "string"
             },
             "sha256": {
              "type": "string"
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "table",
             "sha256"
            ]
           }
          }
         },
         "required": [
          "connection_id",
          "pin",
          "tenant_source",
          "window",
          "tables"
         ]
        }
       }
      }
     },
     "400": {
      "description": "What was sent is not what this operation takes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "There is no such thing here.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Source": {
    "type": "object",
    "properties": {
     "kind": {
      "type": "string",
      "description": "What kind of thing this came from: a query, a method, a record on file, a sealed job, or a sum."
     },
     "title": {
      "type": "string",
      "description": "A plain name for it."
     },
     "check_id": {
      "anyOf": [
       {
        "type": "string",
        "description": "The check that holds the query and its rows: GET /api/v1/checks/sql/{check_id}."
       },
       {
        "type": "null"
       }
      ]
     },
     "method": {
      "anyOf": [
       {
        "type": "string",
        "description": "The method that computed it."
       },
       {
        "type": "null"
       }
      ]
     },
     "tables_read": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "table": {
         "type": "string"
        },
        "rows": {
         "type": "integer"
        }
       },
       "required": [
        "table",
        "rows"
       ]
      },
      "description": "The tables the query read, with their row counts."
     },
     "rows_read": {
      "anyOf": [
       {
        "type": "integer",
        "description": "Rows in the tables read."
       },
       {
        "type": "null"
       }
      ]
     },
     "run_id": {
      "anyOf": [
       {
        "type": "string",
        "description": "The run's id."
       },
       {
        "type": "null"
       }
      ]
     },
     "result_digest": {
      "anyOf": [
       {
        "type": "string",
        "description": "The digest of the run's result."
       },
       {
        "type": "null"
       }
      ]
     },
     "as_of": {
      "anyOf": [
       {
        "type": "string",
        "description": "When it was computed."
       },
       {
        "type": "null"
       }
      ]
     },
     "approved_by": {
      "anyOf": [
       {
        "type": "string",
        "description": "Who approved it, when a person did."
       },
       {
        "type": "null"
       }
      ]
     },
     "approved_at": {
      "anyOf": [
       {
        "type": "string",
        "description": "When it was approved."
       },
       {
        "type": "null"
       }
      ]
     },
     "proof_id": {
      "anyOf": [
       {
        "type": "string",
        "description": "The proof file for it: GET /api/v1/proofs/{proof_id}."
       },
       {
        "type": "null"
       }
      ]
     },
     "produced_by": {
      "type": "string",
      "description": "What produced it, in words: a recorded engine, this server, or a sample input."
     },
     "made_by": {
      "type": "string",
      "description": "For a decision on record: who or what made it."
     },
     "upstream_id": {
      "type": "string",
      "description": "For a decision on record: its id where it is kept."
     },
     "note": {
      "type": "string"
     }
    },
    "required": [
     "kind",
     "title"
    ],
    "description": "Where a number or a decision came from."
   },
   "Figure": {
    "type": "object",
    "properties": {
     "schema": {
      "type": "string",
      "description": "Always precise.figure/v1."
     },
     "label": {
      "type": "string"
     },
     "value": {
      "type": "number"
     },
     "unit": {
      "type": "string",
      "description": "usd, or usd_cpm for a price per thousand impressions."
     },
     "kind": {
      "type": "string",
      "enum": [
       "measured",
       "said"
      ],
      "description": "measured: read from what happened. said: a forecast."
     },
     "basis": {
      "anyOf": [
       {
        "type": "string",
        "description": "What it was measured or forecast on."
       },
       {
        "type": "null"
       }
      ]
     },
     "comparison": {
      "anyOf": [
       {
        "type": "object",
        "description": "What it is set against."
       },
       {
        "type": "null"
       }
      ]
     },
     "range": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "lower": {
          "type": "number"
         },
         "upper": {
          "type": "number"
         },
         "level": {
          "type": "number"
         }
        },
        "required": [
         "lower",
         "upper",
         "level"
        ]
       },
       {
        "type": "null"
       }
      ]
     },
     "run": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ]
     },
     "guide": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "as_of": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "source": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Source"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "required": [
     "schema",
     "label",
     "value",
     "unit",
     "kind"
    ],
    "description": "One number, with whether it was measured or said, and where it came from."
   },
   "Mode": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "enum": [
       "watch",
       "ask",
       "limits"
      ]
     },
     "label": {
      "type": "string"
     },
     "word": {
      "type": "string",
      "description": "The mode in one word."
     },
     "sentence": {
      "type": "string"
     }
    },
    "required": [
     "id",
     "label",
     "word",
     "sentence"
    ]
   },
   "Provenance": {
    "type": "object",
    "properties": {
     "source": {
      "type": "string",
      "description": "recorded: an engine's own output, kept with the tool that made it. computed_here: computed by this server. sample_input: a sample input with no engine behind it. live_tool: run now. upstream: from the connected service."
     }
    },
    "required": [
     "source"
    ],
    "description": "What produced this answer."
   },
   "FeeRow": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string"
     },
     "text": {
      "type": "string"
     },
     "source": {
      "anyOf": [
       {
        "type": "string",
        "description": "Read from the logs, Read from the deal, From the agreement, or Not disclosed."
       },
       {
        "type": "null"
       }
      ]
     },
     "ours": {
      "type": "boolean",
      "description": "True on Precise's own fee."
     }
    },
    "required": [
     "label",
     "text",
     "source",
     "ours"
    ]
   },
   "DealStatus": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "sentence": {
      "type": "string"
     },
     "steps": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "label": {
         "type": "string"
        },
        "done": {
         "type": "boolean"
        }
       },
       "required": [
        "id",
        "label",
        "done"
       ]
      }
     }
    },
    "required": [
     "id",
     "sentence",
     "steps"
    ]
   },
   "Decision": {
    "type": "object",
    "properties": {
     "decision_id": {
      "type": "string"
     },
     "order_id": {
      "type": "string"
     },
     "line_item_id": {
      "type": "string"
     },
     "platform": {
      "anyOf": [
       {
        "type": "string",
        "description": "The buying platform the line runs in."
       },
       {
        "type": "null"
       }
      ]
     },
     "title": {
      "type": "string",
      "description": "The change, in one sentence."
     },
     "status": {
      "type": "string",
      "enum": [
       "open",
       "inside",
       "outside",
       "not_measurable"
      ],
      "description": "open: waiting. inside or outside: the result landed inside or outside the forecast range."
     },
     "state": {
      "type": "string",
      "description": "Where it stands, in words."
     },
     "made_on": {
      "type": "string"
     },
     "results_through": {
      "type": "string"
     },
     "expected": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Figure"
       },
       {
        "type": "null"
       }
      ]
     },
     "result": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Figure"
       },
       {
        "type": "null"
       }
      ]
     },
     "in_period": {
      "type": "boolean",
      "description": "In the scorekeeper: whether its result closed in the month shown."
     },
     "not_counted_why": {
      "type": "string",
      "description": "In the scorekeeper: why a result that closed in the month is not in its total."
     }
    },
    "required": [
     "decision_id",
     "order_id",
     "title",
     "status",
     "state"
    ]
   },
   "Route": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "enum": [
       "platform",
       "deal",
       "agent"
      ]
     },
     "label": {
      "type": "string"
     },
     "recommended": {
      "type": "boolean"
     },
     "sentence": {
      "type": "string"
     },
     "settings": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "label": {
         "type": "string"
        },
        "value": {
         "type": "string"
        }
       },
       "required": [
        "label",
        "value"
       ]
      }
     },
     "fees": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FeeRow"
      }
     },
     "break_even": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "pct": {
          "type": "number"
         },
         "sentence": {
          "type": "string"
         }
        },
        "required": [
         "pct",
         "sentence"
        ]
       },
       {
        "type": "null"
       }
      ]
     },
     "source": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Source"
       },
       {
        "type": "null"
       }
      ]
     },
     "receives": {
      "anyOf": [
       {
        "type": "string",
        "description": "What the platform or the seller receives."
       },
       {
        "type": "null"
       }
      ]
     },
     "deal_id": {
      "type": "string",
      "description": "On the deal route: the Deal ID to target."
     },
     "supply_partner": {
      "type": "string"
     },
     "synced_to": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "The buying platforms the deal is synced to."
     },
     "status": {
      "$ref": "#/components/schemas/DealStatus"
     }
    },
    "required": [
     "id",
     "label",
     "recommended",
     "sentence",
     "settings",
     "fees",
     "break_even"
    ],
    "description": "One way a change goes out, with its own fees."
   },
   "Approval": {
    "type": "object",
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "ready",
       "approved",
       "watching",
       "closed"
      ]
     },
     "route": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "method": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "approved_by": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "approved_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "proof_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "sentence": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "checked": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "rule": {
         "type": "string"
        },
        "ok": {
         "type": "boolean"
        },
        "why": {
         "type": "string"
        }
       },
       "required": [
        "rule",
        "ok",
        "why"
       ]
      },
      "description": "Within approved limits: each stored rule, checked against this decision."
     }
    },
    "required": [
     "state"
    ]
   },
   "Applied": {
    "type": "object",
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "none",
       "not_applied",
       "result_recorded",
       "not_measurable"
      ]
     },
     "sentence": {
      "type": "string"
     },
     "counted_usd": {
      "type": "number",
      "description": "What is counted so far. A change that is approved and not applied counts for 0."
     }
    },
    "required": [
     "state",
     "sentence",
     "counted_usd"
    ]
   },
   "Check": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "ok": {
      "type": "boolean"
     },
     "detail": {
      "type": "string"
     }
    },
    "required": [
     "id",
     "title",
     "ok",
     "detail"
    ]
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      },
      "required": [
       "code",
       "message"
      ]
     }
    },
    "required": [
     "error"
    ]
   },
   "DecisionAnswer": {
    "anyOf": [
     {
      "type": "object",
      "properties": {
       "decision_id": {
        "type": "string"
       },
       "order_id": {
        "type": "string"
       },
       "line_item_id": {
        "type": "string"
       },
       "platform": {
        "anyOf": [
         {
          "type": "string"
         },
         {
          "type": "null"
         }
        ]
       },
       "title": {
        "type": "string"
       },
       "status": {
        "type": "string"
       },
       "state": {
        "type": "string"
       },
       "expected": {
        "anyOf": [
         {
          "$ref": "#/components/schemas/Figure"
         },
         {
          "type": "null"
         }
        ]
       },
       "result": {
        "anyOf": [
         {
          "$ref": "#/components/schemas/Figure"
         },
         {
          "type": "null"
         }
        ]
       },
       "known": {
        "type": "string",
        "description": "What was known when the decision was made."
       },
       "rows": {
        "type": "object",
        "properties": {
         "changes": {
          "type": "object",
          "properties": {
           "sentence": {
            "type": "string"
           },
           "where": {
            "type": "string"
           }
          },
          "required": [
           "sentence",
           "where"
          ]
         },
         "expect": {
          "type": "object",
          "properties": {
           "sentence": {
            "type": "string"
           }
          },
          "required": [
           "sentence"
          ]
         },
         "compared_with": {
          "type": "object",
          "properties": {
           "sentence": {
            "type": "string"
           },
           "held_line": {
            "type": "string"
           },
           "risk_budget_pct": {
            "type": "number"
           },
           "how_it_works": {
            "type": "string"
           }
          },
          "required": [
           "sentence",
           "held_line",
           "risk_budget_pct",
           "how_it_works"
          ]
         },
         "costs": {
          "type": "object",
          "properties": {
           "sentence": {
            "type": "string"
           }
          },
          "required": [
           "sentence"
          ]
         }
        },
        "required": [
         "changes",
         "expect",
         "compared_with",
         "costs"
        ]
       },
       "routes": {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/Route"
        },
        "description": "The ways this change can go out. Empty once the decision has its result."
       },
       "approval": {
        "$ref": "#/components/schemas/Approval"
       },
       "applied": {
        "$ref": "#/components/schemas/Applied"
       },
       "landed": {
        "anyOf": [
         {
          "type": "string"
         },
         {
          "type": "null"
         }
        ]
       },
       "order_check_id": {
        "anyOf": [
         {
          "type": "string",
          "description": "The check that holds today's query on this decision's order, when there is one."
         },
         {
          "type": "null"
         }
        ]
       },
       "mode": {
        "$ref": "#/components/schemas/Mode"
       },
       "source": {
        "$ref": "#/components/schemas/Source"
       },
       "provenance": {
        "$ref": "#/components/schemas/Provenance"
       },
       "diff": {
        "type": "object"
       },
       "current_seat": {
        "type": "object"
       },
       "rollback": {
        "type": "object"
       }
      },
      "required": [
       "decision_id",
       "order_id",
       "title",
       "status",
       "state",
       "known",
       "rows",
       "routes",
       "approval",
       "applied",
       "mode",
       "source",
       "provenance"
      ]
     },
     {
      "type": "object",
      "properties": {
       "decision_id": {
        "type": "string"
       },
       "review_only": {
        "const": true
       },
       "current_seat": {
        "type": "object"
       },
       "diff": {
        "type": "object"
       },
       "rollback": {
        "type": "object"
       }
      },
      "required": [
       "decision_id",
       "review_only",
       "current_seat",
       "diff",
       "rollback"
      ]
     }
    ]
   },
   "AuthorityAnswer": {
    "type": "object",
    "properties": {
     "mode": {
      "$ref": "#/components/schemas/Mode"
     },
     "modes": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "label": {
         "type": "string"
        },
        "word": {
         "type": "string"
        },
        "sentence": {
         "type": "string"
        },
        "selected": {
         "type": "boolean"
        }
       },
       "required": [
        "id",
        "label",
        "word",
        "sentence",
        "selected"
       ]
      }
     },
     "rules": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "text": {
         "type": "string"
        },
        "from": {
         "type": "string"
        },
        "active": {
         "type": "boolean"
        }
       },
       "required": [
        "id",
        "text",
        "from",
        "active"
       ]
      }
     },
     "limits": {
      "type": "object",
      "properties": {
       "plan_id": {
        "type": "string"
       },
       "name": {
        "type": "string"
       },
       "currency": {
        "type": "string"
       },
       "cap": {
        "type": "number"
       },
       "committed": {
        "type": "number"
       },
       "set_aside": {
        "type": "number"
       },
       "remaining": {
        "type": "number"
       },
       "flight": {
        "type": "object"
       },
       "approved_sellers": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "sentence": {
        "type": "string"
       },
       "offers": {
        "type": "array",
        "items": {
         "type": "object"
        }
       }
      },
      "required": [
       "plan_id",
       "name",
       "currency",
       "cap",
       "committed",
       "set_aside",
       "remaining",
       "flight",
       "approved_sellers",
       "sentence",
       "offers"
      ]
     },
     "holdout": {
      "type": "object",
      "properties": {
       "risk_budget_pct": {
        "type": "number"
       },
       "range": {
        "type": "object",
        "properties": {
         "min": {
          "type": "number"
         },
         "max": {
          "type": "number"
         },
         "step": {
          "type": "number"
         }
        },
        "required": [
         "min",
         "max",
         "step"
        ]
       },
       "sentence": {
        "type": "string"
       },
       "how_it_works": {
        "type": "string"
       },
       "people_test_example": {
        "type": "string"
       }
      },
      "required": [
       "risk_budget_pct",
       "range",
       "sentence",
       "how_it_works",
       "people_test_example"
      ]
     },
     "provenance": {
      "$ref": "#/components/schemas/Provenance"
     }
    },
    "required": [
     "mode",
     "modes",
     "rules",
     "limits",
     "holdout",
     "provenance"
    ]
   }
  }
 },
 "x-precise-source": "Precise Access public_test profile with native ratio math, captured 24 Nov 2026"
}
