{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agenticinsuranceprotocol.org/schemas/0.1/schema.json",
  "title": "Agentic Insurance Protocol (AIP), draft 0.1",
  "description": "Generated from schema.ts and registry.ts. Do not edit by hand.",
  "definitions": {
    "AipError": {
      "type": "object",
      "properties": {
        "code": {
          "$ref": "#/definitions/AipErrorCode"
        },
        "message": {
          "type": "string"
        },
        "fields": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FieldIssue"
          }
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false,
      "description": "Error returned in an MCP tool result with `isError: true`, in `structuredContent.error`. PAP errors (`insufficient_scope`, `sign_in_required`, `terms_changed`) keep their PAP form."
    },
    "AipErrorCode": {
      "type": "string",
      "enum": [
        "not_licensed",
        "not_available_in_region",
        "product_not_found",
        "offer_not_found",
        "offer_expired",
        "question_set_outdated",
        "sensitive_field_received",
        "documents_not_delivered",
        "answers_invalid",
        "answers_not_validated",
        "accuracy_not_confirmed",
        "needs_assessment_invalid",
        "not_supported"
      ]
    },
    "AipProgress": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "licensed_review",
            "provider_decision",
            "customer_action_on_distributor_page",
            "payment_pending"
          ]
        },
        "url": {
          "$ref": "#/definitions/Url"
        },
        "expected_by": {
          "$ref": "#/definitions/DateTimeString"
        }
      },
      "required": [
        "reason"
      ],
      "additionalProperties": false
    },
    "AipSettings": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Protocol version the server implements."
        },
        "conformance_level": {
          "$ref": "#/definitions/ConformanceLevel"
        },
        "interfaces": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InterfaceKind"
          }
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProductLine"
          },
          "description": "Product lines the server can quote."
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          },
          "description": "Countries where the server's products are sold."
        },
        "can_conclude": {
          "type": "boolean",
          "description": "True when the server can conclude an agreement inside the agent (`conclude`). False when the customer always finishes on the distributor's own page."
        }
      },
      "required": [
        "version",
        "conformance_level",
        "interfaces",
        "lines",
        "countries",
        "can_conclude"
      ],
      "additionalProperties": false,
      "description": "Settings object of the extension. A server puts it under `capabilities.extensions[\"org.agenticinsuranceprotocol/aip\"]` in its MCP `server/discover` response, and under the same key in the `extensions` field of its PAP `poppy.json`."
    },
    "AnswerOrigin": {
      "type": "string",
      "enum": [
        "customer",
        "agent",
        "third_party"
      ],
      "description": "Who produced the value of an answer."
    },
    "AnswerSource": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "origin": {
              "type": "string",
              "const": "customer"
            },
            "validated_by_customer": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "origin",
            "validated_by_customer"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "origin": {
              "type": "string",
              "const": "agent"
            },
            "validated_by_customer": {
              "type": "boolean"
            }
          },
          "required": [
            "origin",
            "validated_by_customer"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "origin": {
              "type": "string",
              "const": "third_party"
            },
            "validated_by_customer": {
              "type": "boolean"
            },
            "source_name": {
              "type": "string",
              "description": "The third party, by its kind and country, for example \"vehicle register (FR)\"."
            }
          },
          "required": [
            "origin",
            "validated_by_customer",
            "source_name"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Where one answer comes from. `validated_by_customer` is true when the customer confirmed this value before the agent sent it. It is always true when the customer gave the value. An agent MUST NOT set `validated_by_customer` to true when the customer did not validate that answer."
    },
    "AnswerSources": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/AnswerSource"
      },
      "description": "The source of each answer, keyed like `answers`. An agent MUST give a source for each answer, and no source for a key that has no answer. Otherwise the server returns `answers_invalid`."
    },
    "Answers": {
      "type": "object",
      "additionalProperties": {},
      "description": "Answers keyed by property name in `answers_schema`."
    },
    "AnswersSchema": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "object"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "type",
        "properties"
      ],
      "additionalProperties": {},
      "description": "A JSON Schema (2020-12) object that describes the answers. Each property is one question. AIP adds these keywords to each property:\n\n- `x-collected-by`: a `CollectedBy` value. Default `agent`.\n- `x-profile-key`: the key of the matching question in the line profile,   when the question is part of the common core.\n- `x-ask`: a short question the agent can ask the customer, in plain words."
    },
    "AnswersValidation": {
      "type": "object",
      "properties": {
        "operation_id": {
          "type": "string"
        },
        "revision": {
          "type": "number"
        },
        "validated_at": {
          "$ref": "#/definitions/DateTimeString",
          "description": "When the customer approved the operation: its `confirmation.confirmed_at`."
        },
        "answers_sha256": {
          "$ref": "#/definitions/Sha256"
        },
        "answer_sources_sha256": {
          "$ref": "#/definitions/Sha256"
        }
      },
      "required": [
        "operation_id",
        "revision",
        "validated_at",
        "answers_sha256",
        "answer_sources_sha256"
      ],
      "additionalProperties": false,
      "description": "The record that the customer validated a set of answers and their sources: a succeeded `validate_answers` operation. The server keeps it. The agent copies it into `quote` to get binding offers, and into the declaration of an application."
    },
    "ApplicationOutcome": {
      "type": "object",
      "properties": {
        "application_id": {
          "type": "string"
        },
        "evidence": {
          "$ref": "#/definitions/EvidenceRecord"
        },
        "handoff_url": {
          "$ref": "#/definitions/Url",
          "description": "Page where the customer finishes the subscription."
        }
      },
      "required": [
        "application_id",
        "evidence",
        "handoff_url"
      ],
      "additionalProperties": false
    },
    "ApplicationTerms": {
      "type": "object",
      "properties": {
        "offer_id": {
          "type": "string"
        },
        "product_id": {
          "type": "string"
        },
        "provider": {
          "$ref": "#/definitions/ProviderRef"
        },
        "pricing": {
          "$ref": "#/definitions/Pricing",
          "description": "The pricing of the offer, unchanged. It MUST be the `pricing` that `quote` returned for `offer_id`."
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "start_date": {
          "$ref": "#/definitions/DateString"
        },
        "parties": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Party"
          }
        },
        "declaration": {
          "$ref": "#/definitions/Declaration"
        },
        "needs_assessment": {
          "$ref": "#/definitions/NeedsAssessment"
        },
        "documents_delivered": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeliveredDocument"
          },
          "description": "Documents delivered before this revision was proposed. Every document of the offer with `required_before_commitment: true` MUST be in this list."
        },
        "contact_consent": {
          "$ref": "#/definitions/ContactConsent"
        },
        "withdrawal_period_days": {
          "type": "number",
          "description": "Days the customer has to withdraw after conclusion, when the law gives the right."
        }
      },
      "required": [
        "offer_id",
        "product_id",
        "provider",
        "pricing",
        "options",
        "parties",
        "declaration",
        "needs_assessment",
        "documents_delivered",
        "contact_consent"
      ],
      "additionalProperties": false,
      "description": "Terms of an application or a conclusion. Every field the law needs as evidence is here, so that a confirmed revision records exactly what the customer accepted."
    },
    "CheckedSubject": {
      "type": "object",
      "properties": {
        "legal_name": {
          "type": "string",
          "description": "Legal name, from the AIP server of the domain or from the register."
        },
        "lei": {
          "$ref": "#/definitions/Lei",
          "description": "Legal entity identifier, from the AIP server of the domain or from the register."
        },
        "domain": {
          "$ref": "#/definitions/DomainName"
        },
        "domain_link": {
          "$ref": "#/definitions/DomainLink",
          "description": "How the registry tied the domain to the entries. Present when the params give a domain."
        },
        "listed": {
          "type": "boolean",
          "description": "True when the registry lists an AIP server on the domain."
        },
        "mcp_url": {
          "$ref": "#/definitions/Url",
          "description": "MCP endpoint of the listed server."
        }
      },
      "required": [
        "listed"
      ],
      "additionalProperties": false,
      "description": "What the registry found about the party it checked."
    },
    "CollectedBy": {
      "type": "string",
      "enum": [
        "agent",
        "distributor_page"
      ],
      "description": "Who collects the value of a question.\n- `agent`: the agent MAY ask and send the value.\n- `distributor_page`: the value MUST NOT pass through the agent. The customer   gives it on the distributor's own page. Use it for identity numbers, bank   account and card numbers, tax numbers, health details and passwords."
    },
    "ConcludeOutcome": {
      "type": "object",
      "properties": {
        "agreement_number": {
          "type": "string"
        },
        "evidence": {
          "$ref": "#/definitions/EvidenceRecord"
        },
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InsuranceDocument"
          }
        }
      },
      "required": [
        "agreement_number",
        "evidence",
        "documents"
      ],
      "additionalProperties": false
    },
    "ConcludeParams": {
      "$ref": "#/definitions/SubmitApplicationParams"
    },
    "ConcludeResult": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/definitions/Operation%3CApplicationTerms%3E"
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false,
      "description": "Result of `conclude`. The operation MUST have `user_approval_required: true`. When it succeeds, `result.data` holds a `ConcludeOutcome`."
    },
    "ConformanceLevel": {
      "type": "number",
      "enum": [
        1,
        2,
        3
      ],
      "description": "Conformance level that a distributor declares.\n\n- 1 Inform: `get_distributor`, `list_products`, `get_documents`\n- 2 Quote: level 1, plus `get_question_set`, `quote` and `validate_answers`\n- 3 Subscribe: level 2, plus `submit_application` or `conclude`\n\nA server that declares a level MUST implement every tool of that level and of the levels below it, except that level 3 needs only one of `submit_application` and `conclude`. A server at level 2 can give binding offers, because it implements `validate_answers`."
    },
    "ContactConsent": {
      "type": "object",
      "properties": {
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "email",
              "phone",
              "sms",
              "post"
            ]
          },
          "description": "Channels the distributor MAY use to contact the customer. Empty means none."
        },
        "details_collected_by": {
          "$ref": "#/definitions/CollectedBy",
          "description": "When `distributor_page`, the contact details never pass through the agent."
        },
        "providers_may_contact": {
          "type": "boolean",
          "description": "True only when the customer agreed that providers may contact them too."
        },
        "purposes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Purposes the customer agreed to, for example \"this_application\", \"marketing\"."
        }
      },
      "required": [
        "channels",
        "details_collected_by",
        "providers_may_contact",
        "purposes"
      ],
      "additionalProperties": false,
      "description": "The customer's choice about later contact."
    },
    "ConversationData": {
      "type": "object",
      "properties": {
        "question": {
          "type": "object",
          "properties": {
            "field": {
              "type": "string"
            },
            "ask": {
              "type": "string"
            },
            "schema": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "required": [
            "field",
            "ask",
            "schema"
          ],
          "additionalProperties": false
        },
        "quote": {
          "$ref": "#/definitions/QuoteResult"
        },
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InsuranceDocument"
          }
        },
        "operation": {
          "$ref": "#/definitions/Operation%3CApplicationTerms%3E"
        }
      },
      "additionalProperties": false,
      "description": "PROPOSED. Some distributors expose only a company agent. If AIP accepts them at level 2, each message that carries an AIP object puts it here, in the message's structured data (`data` in a PAP conversation, `structuredContent` in a chat tool)."
    },
    "CountryCode": {
      "type": "string",
      "description": "ISO 3166-1 alpha-2 country code, upper case.",
      "pattern": "^[A-Z]{2}$"
    },
    "CoverLimit": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Stable key, for example \"vet_costs_per_year\"."
        },
        "label": {
          "type": "string"
        },
        "limit": {
          "$ref": "#/definitions/Money"
        },
        "reimbursement_rate": {
          "type": "number",
          "description": "Share of a claim paid back, from 0 to 1. Used by pet and health cover."
        }
      },
      "required": [
        "key",
        "label"
      ],
      "additionalProperties": false
    },
    "CoverSummary": {
      "type": "object",
      "properties": {
        "included": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Covers included, as short labels."
        },
        "limits": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CoverLimit"
          }
        },
        "excess": {
          "$ref": "#/definitions/Money"
        },
        "main_exclusions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Main exclusions. The full list is in the documents."
        },
        "waiting_period_days": {
          "type": "number"
        }
      },
      "required": [
        "included"
      ],
      "additionalProperties": false
    },
    "CurrencyCode": {
      "type": "string",
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$"
    },
    "DateString": {
      "type": "string",
      "description": "Calendar date, ISO 8601.",
      "format": "date"
    },
    "DateTimeString": {
      "type": "string",
      "description": "Date and time with offset, ISO 8601.",
      "format": "date-time"
    },
    "Decimal": {
      "type": "string",
      "description": "A decimal number as a string, so that no value is lost to floating point, for example \"12.90\".",
      "pattern": "^-?[0-9]+(\\.[0-9]+)?$"
    },
    "Declaration": {
      "type": "object",
      "properties": {
        "question_set": {
          "$ref": "#/definitions/QuestionSetRef"
        },
        "answers": {
          "$ref": "#/definitions/Answers"
        },
        "answer_sources": {
          "$ref": "#/definitions/AnswerSources",
          "description": "Where each answer comes from, keyed like `answers`."
        },
        "answers_sha256": {
          "$ref": "#/definitions/Sha256"
        },
        "answer_sources_sha256": {
          "$ref": "#/definitions/Sha256"
        },
        "accuracy_confirmed": {
          "type": "boolean",
          "description": "True when the customer confirmed that the answers are true and complete. The agent MUST NOT set it to true for invented or test data."
        },
        "validation": {
          "$ref": "#/definitions/AnswersValidation",
          "description": "The customer's validation of these answers and sources. Its hashes MUST be `answers_sha256` and `answer_sources_sha256`, and its operation MUST have succeeded. Otherwise the server returns `answers_not_validated`."
        }
      },
      "required": [
        "question_set",
        "answers",
        "answer_sources",
        "answers_sha256",
        "answer_sources_sha256",
        "accuracy_confirmed",
        "validation"
      ],
      "additionalProperties": false,
      "description": "The answers the customer commits to, with their sources and the customer's validation."
    },
    "DeliveredDocument": {
      "type": "object",
      "properties": {
        "document_id": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "sha256": {
          "$ref": "#/definitions/Sha256"
        },
        "delivered_at": {
          "$ref": "#/definitions/DateTimeString"
        }
      },
      "required": [
        "document_id",
        "version",
        "sha256",
        "delivered_at"
      ],
      "additionalProperties": false
    },
    "DistributorCheckParams": {
      "type": "object",
      "properties": {
        "capacity": {
          "type": "string",
          "const": "distributor"
        },
        "subject": {
          "$ref": "#/definitions/SellerSubject"
        },
        "country": {
          "$ref": "#/definitions/CountryCode",
          "description": "Country where the customer buys."
        },
        "subdivision": {
          "$ref": "#/definitions/SubdivisionCode",
          "description": "Subdivision where the customer buys. REQUIRED for a country in `PER_SUBDIVISION_COUNTRIES`, such as the United States."
        },
        "line": {
          "$ref": "#/definitions/ProductLine"
        }
      },
      "required": [
        "capacity",
        "subject",
        "country"
      ],
      "additionalProperties": false,
      "description": "Params of `verify_licence` for a seller. Every distribution role counts, including an insurer that sells its own products.\n\nThe check MUST work for a seller that the registry does not list. An agent can find a seller anywhere on the web, and the check matters most then."
    },
    "DistributorRole": {
      "anyOf": [
        {
          "$ref": "#/definitions/ProviderRole"
        },
        {
          "type": "string",
          "const": "broker"
        },
        {
          "type": "string",
          "const": "agent"
        },
        {
          "type": "string",
          "const": "mga"
        },
        {
          "type": "string",
          "const": "comparator"
        }
      ],
      "description": "Role of a party in the distribution chain. The provider roles are in `ProviderRole`."
    },
    "DocumentType": {
      "type": "string",
      "enum": [
        "pre_contract_information",
        "terms_of_business",
        "other",
        "ipid",
        "general_conditions",
        "special_conditions",
        "demands_and_needs",
        "proof_of_insurance"
      ],
      "description": "Kind of document."
    },
    "DomainLink": {
      "type": "string",
      "enum": [
        "register",
        "confirmed",
        "claimed",
        "not_linked"
      ],
      "description": "How the registry tied a domain to register entries. Only \"register\" and \"confirmed\" support the verdict \"licensed\"."
    },
    "DomainName": {
      "type": "string",
      "description": "Host name, lower case, with no scheme, port or path, for example \"pets.example.com\".",
      "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
    },
    "EvidenceRecord": {
      "type": "object",
      "properties": {
        "record_id": {
          "type": "string"
        },
        "operation_id": {
          "type": "string"
        },
        "revision": {
          "type": "number"
        },
        "approved_by": {
          "type": "string",
          "enum": [
            "user",
            "standing_permission"
          ]
        },
        "confirmed_at": {
          "$ref": "#/definitions/DateTimeString"
        },
        "documents_delivered": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeliveredDocument"
          }
        },
        "question_set": {
          "$ref": "#/definitions/QuestionSetRef"
        },
        "answers_sha256": {
          "$ref": "#/definitions/Sha256"
        },
        "answer_sources_sha256": {
          "$ref": "#/definitions/Sha256",
          "description": "SHA-256 of the canonical JSON (RFC 8785) of the answer sources. The server MUST keep the sources with the declaration."
        },
        "validation": {
          "$ref": "#/definitions/AnswersValidation",
          "description": "The customer's validation of the answers and their sources."
        },
        "underwriting_scope_version": {
          "type": "string",
          "description": "Version of the underwriting scope that the offer applied."
        },
        "needs_assessment": {
          "$ref": "#/definitions/NeedsAssessment"
        },
        "contact_consent": {
          "$ref": "#/definitions/ContactConsent"
        },
        "terms_sha256": {
          "$ref": "#/definitions/Sha256",
          "description": "SHA-256 of the canonical JSON (RFC 8785) of the confirmed `terms`."
        }
      },
      "required": [
        "record_id",
        "operation_id",
        "revision",
        "approved_by",
        "confirmed_at",
        "documents_delivered",
        "question_set",
        "answers_sha256",
        "answer_sources_sha256",
        "validation",
        "underwriting_scope_version",
        "needs_assessment",
        "contact_consent",
        "terms_sha256"
      ],
      "additionalProperties": false,
      "description": "What the distributor keeps when an operation succeeds. It links the exact revision the customer accepted to the documents, the declaration with its sources and its validation, the needs assessment, the consent and the underwriting scope. The distributor MUST keep it for the period the law requires.\n\nA PAP confirmation proves that an agent stated the customer approved a revision. It does not prove that the customer saw the terms. This record adds what was delivered and what was declared. It still does not prove that the customer read the documents."
    },
    "FieldIssue": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "issue": {
          "type": "string",
          "enum": [
            "missing",
            "invalid",
            "not_accepted"
          ]
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "field",
        "issue"
      ],
      "additionalProperties": false
    },
    "Geography": {
      "type": "object",
      "properties": {
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          },
          "description": "Countries the product covers. At least one.",
          "minItems": 1
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubdivisionCode"
          },
          "description": "Subdivisions the product covers, for example US states. Each one MUST belong to a country in `countries`. The product covers the whole of each country that has no subdivision in this list."
        }
      },
      "required": [
        "countries"
      ],
      "additionalProperties": false,
      "description": "Where the insured person lives, or where the insured good is."
    },
    "GetCountryRulesParams": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode"
        },
        "subdivision": {
          "$ref": "#/definitions/SubdivisionCode",
          "description": "Adds the file of this subdivision, when one exists."
        },
        "line": {
          "$ref": "#/definitions/ProductLine",
          "description": "Adds the file of this line in the country, when one exists."
        }
      },
      "required": [
        "country"
      ],
      "additionalProperties": false,
      "description": "Params of `get_country_rules`."
    },
    "GetCountryRulesResult": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RulesFile"
          },
          "minItems": 1
        }
      },
      "required": [
        "files"
      ],
      "additionalProperties": false,
      "description": "Result of `get_country_rules`.\n\n- `files` MUST start with the file of the country. The file of the   subdivision and then the file of the line follow, when they exist.\n- For a country with no rules file, the registry MUST return the error   \"country_not_covered\".\n- Each file MUST be the same text as the file of the same version in the   skill, so that `sha256` is the same in both places.\n- An agent MUST follow every file of the result. When the registry does not   answer, the agent uses the copy in its installed skill, and SHOULD tell the   customer which version it used."
    },
    "GetDistributorParams": {
      "type": "object",
      "additionalProperties": false,
      "description": "Params of `get_distributor`. No params."
    },
    "GetDistributorResult": {
      "type": "object",
      "properties": {
        "legal_name": {
          "type": "string"
        },
        "trading_name": {
          "type": "string"
        },
        "domain": {
          "type": "string",
          "description": "Domain the distributor controls. It MUST match the server's own domain."
        },
        "lei": {
          "$ref": "#/definitions/Lei",
          "description": "Legal Entity Identifier, when the distributor has one. The registry uses it to match one company across registers."
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DistributorRole"
          }
        },
        "licences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Licence"
          },
          "description": "Every licence the distributor relies on to sell the listed products."
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          }
        },
        "complaints_url": {
          "$ref": "#/definitions/Url",
          "description": "Where a customer can complain. Required by most regulators."
        },
        "aip": {
          "$ref": "#/definitions/AipSettings",
          "description": "Settings the server declares for AIP."
        }
      },
      "required": [
        "legal_name",
        "domain",
        "roles",
        "licences",
        "countries",
        "aip"
      ],
      "additionalProperties": false
    },
    "GetDocumentsParams": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "product_id": {
              "type": "string"
            },
            "country": {
              "$ref": "#/definitions/CountryCode"
            },
            "language": {
              "$ref": "#/definitions/LanguageTag"
            }
          },
          "required": [
            "product_id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "offer_id": {
              "type": "string"
            },
            "language": {
              "$ref": "#/definitions/LanguageTag"
            }
          },
          "required": [
            "offer_id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Params of `get_documents`. Give exactly one of the two references."
    },
    "GetDocumentsResult": {
      "type": "object",
      "properties": {
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InsuranceDocument"
          }
        }
      },
      "required": [
        "documents"
      ],
      "additionalProperties": false
    },
    "GetQuestionSetParams": {
      "type": "object",
      "properties": {
        "product_id": {
          "type": "string"
        },
        "country": {
          "$ref": "#/definitions/CountryCode"
        }
      },
      "required": [
        "product_id"
      ],
      "additionalProperties": false
    },
    "GetQuestionSetResult": {
      "type": "object",
      "properties": {
        "question_set": {
          "$ref": "#/definitions/QuestionSet"
        }
      },
      "required": [
        "question_set"
      ],
      "additionalProperties": false
    },
    "InsuranceDocument": {
      "type": "object",
      "properties": {
        "document_id": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/DocumentType"
        },
        "title": {
          "type": "string"
        },
        "language": {
          "$ref": "#/definitions/LanguageTag"
        },
        "version": {
          "type": "string",
          "description": "Version label set by the distributor. A new text MUST get a new version."
        },
        "url": {
          "$ref": "#/definitions/Url"
        },
        "media_type": {
          "type": "string"
        },
        "sha256": {
          "$ref": "#/definitions/Sha256",
          "description": "Digest of the exact file at `url`. Used as evidence of what was delivered."
        },
        "required_before_commitment": {
          "type": "boolean",
          "description": "True when the law requires that the customer receives this document before they commit, for example the IPID."
        }
      },
      "required": [
        "document_id",
        "type",
        "title",
        "language",
        "version",
        "url",
        "media_type",
        "sha256",
        "required_before_commitment"
      ],
      "additionalProperties": false
    },
    "InsuredFamily": {
      "type": "string",
      "description": "Family of what a product insures: a kind of person, or a kind of good. Servers SHOULD use a value of `KnownInsuredFamily`. Other values MUST be lower case with underscores.",
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "InsuredType": {
      "type": "object",
      "properties": {
        "family": {
          "$ref": "#/definitions/InsuredFamily"
        },
        "kinds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Kinds that the product covers, for example \"cat\" and \"dog\". Omit when it covers every kind. When the line profile names a `kind_key` for this family, each kind MUST be a value that this question accepts."
        }
      },
      "required": [
        "family"
      ],
      "additionalProperties": false,
      "description": "A family of insured, and the kinds of it that a product covers."
    },
    "InterfaceKind": {
      "type": "string",
      "enum": [
        "tools",
        "conversation"
      ],
      "description": "How a distributor exposes the protocol."
    },
    "KnownInsuredFamily": {
      "type": "string",
      "enum": [
        "person",
        "organisation",
        "pet",
        "dwelling",
        "contents",
        "vehicle"
      ],
      "description": "Families that the known product lines need."
    },
    "KnownNoOfferReason": {
      "type": "string",
      "enum": [
        "outside_underwriting_scope",
        "risk_not_accepted",
        "age_not_accepted",
        "breed_not_accepted",
        "claims_history_not_accepted"
      ],
      "description": "Common reason codes. `outside_underwriting_scope` means that the risk is outside the product's underwriting scope: its geography, its insured types or its conditions. A quote for a risk outside the structured part MUST get this reason."
    },
    "KnownProductLine": {
      "type": "string",
      "enum": [
        "pet",
        "home",
        "renters",
        "motor",
        "travel",
        "health",
        "life",
        "funeral",
        "borrower_insurance",
        "professional_liability",
        "general_liability",
        "business_owners_policy",
        "workers_compensation"
      ],
      "description": "Lines that have, or will have, a profile in AIP."
    },
    "LanguageTag": {
      "type": "string",
      "description": "BCP 47 language tag, for example `fr` or `es-ES`.",
      "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"
    },
    "Lei": {
      "type": "string",
      "description": "Legal Entity Identifier (ISO 17442): 18 letters or digits, then 2 check digits.",
      "pattern": "^[A-Z0-9]{18}[0-9]{2}$"
    },
    "Licence": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode"
        },
        "regulator": {
          "type": "string",
          "description": "Supervising authority, for example \"ACPR\", \"FCA\", \"DGSFP\"."
        },
        "register": {
          "type": "string",
          "description": "Name of the public register, for example \"ORIAS\", \"REGAFI\", \"FCA Register\", \"NIPR\"."
        },
        "identifier_type": {
          "$ref": "#/definitions/RegisterIdentifierType"
        },
        "identifier": {
          "type": "string"
        },
        "role": {
          "$ref": "#/definitions/DistributorRole"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Register categories, for example ORIAS \"COA\" (insurance broker) or \"AGA\" (tied insurance agent)."
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubdivisionCode"
          },
          "description": "Subdivisions where the licence applies, for example US states as ISO 3166-2 codes (\"US-CA\"). Omit when the licence covers the whole country."
        },
        "verification_url": {
          "$ref": "#/definitions/Url",
          "description": "Public page where anyone can check the entry."
        }
      },
      "required": [
        "country",
        "regulator",
        "register",
        "identifier_type",
        "identifier",
        "role"
      ],
      "additionalProperties": false,
      "description": "One entry in a public register that gives the right to sell a product, or to carry its risk."
    },
    "LicenceCheck": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode"
        },
        "regulator": {
          "type": "string",
          "description": "Supervising authority, for example \"ACPR\", \"FCA\", or a US state insurance department."
        },
        "register": {
          "type": "string",
          "description": "Name of the public register, for example \"ORIAS\", \"FCA Register\", \"NIPR\"."
        },
        "identifier_type": {
          "$ref": "#/definitions/RegisterIdentifierType"
        },
        "identifier": {
          "type": "string"
        },
        "role": {
          "$ref": "#/definitions/DistributorRole",
          "description": "Role that the entry gives. Omit when the status is \"not_found\"."
        },
        "status": {
          "$ref": "#/definitions/LicenceStatus"
        },
        "register_status": {
          "type": "string",
          "description": "The status in the words of the register, for example \"Authorised\" or \"Inscrit\"."
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Register categories, for example ORIAS \"COA\" or US lines of authority."
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProductLine"
          },
          "description": "Lines that the categories cover, mapped by the registry. Omit when the categories cover every line."
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubdivisionCode"
          },
          "description": "Subdivisions where the entry applies. Omit when it covers the whole country."
        },
        "passports": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          },
          "description": "Other countries where the entry may operate, under the freedom to provide services or the freedom of establishment (EU and EEA), as the register shows them."
        },
        "name_in_register": {
          "type": "string",
          "description": "Name of the holder in the register."
        },
        "valid_until": {
          "$ref": "#/definitions/DateString",
          "description": "Last day of the entry, when the register gives one."
        },
        "access": {
          "$ref": "#/definitions/SourceAccess",
          "description": "How the registry read the register."
        },
        "source_date": {
          "$ref": "#/definitions/DateString",
          "description": "Date of the data in the source, when it is older than the read, for example the date of a bulk file."
        },
        "checked_at": {
          "$ref": "#/definitions/DateTimeString",
          "description": "When the registry read this entry."
        },
        "source_url": {
          "$ref": "#/definitions/Url",
          "description": "Public page where anyone can check the entry, or the search page of the register."
        }
      },
      "required": [
        "country",
        "regulator",
        "register",
        "identifier_type",
        "identifier",
        "status",
        "access",
        "checked_at",
        "source_url"
      ],
      "additionalProperties": false,
      "description": "The result of reading one entry in one public register."
    },
    "LicenceStatus": {
      "type": "string",
      "enum": [
        "active",
        "pending",
        "lapsed",
        "suspended",
        "revoked",
        "not_found",
        "name_mismatch"
      ],
      "description": "Status of one register entry, as the registry reads it."
    },
    "LicenceVerdict": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "verdict": {
              "type": "string",
              "const": "licensed"
            },
            "message": {
              "type": "string",
              "description": "Plain-language explanation that the agent can pass to the customer."
            }
          },
          "required": [
            "verdict",
            "message"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "verdict": {
              "type": "string",
              "const": "not_licensed"
            },
            "reason": {
              "$ref": "#/definitions/NotLicensedReason"
            },
            "message": {
              "type": "string",
              "description": "Plain-language explanation that the agent can pass to the customer."
            }
          },
          "required": [
            "verdict",
            "reason",
            "message"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "verdict": {
              "type": "string",
              "const": "unknown"
            },
            "reason": {
              "$ref": "#/definitions/UnknownReason"
            },
            "message": {
              "type": "string",
              "description": "Plain-language explanation that the agent can pass to the customer."
            }
          },
          "required": [
            "verdict",
            "reason",
            "message"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The answer to the question of the agent."
    },
    "ListProductsParams": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode"
        },
        "subdivision": {
          "$ref": "#/definitions/SubdivisionCode",
          "description": "Products that cover this subdivision."
        },
        "line": {
          "$ref": "#/definitions/ProductLine"
        },
        "insured_family": {
          "$ref": "#/definitions/InsuredFamily",
          "description": "Products that insure this family."
        },
        "cursor": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "description": "Params of `list_products`. Each filter is optional. The server MUST return only the products whose line and underwriting scope match every filter given."
    },
    "ListProductsResult": {
      "type": "object",
      "properties": {
        "products": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product"
          }
        },
        "next_cursor": {
          "type": "string"
        }
      },
      "required": [
        "products"
      ],
      "additionalProperties": false
    },
    "ListedDistributor": {
      "type": "object",
      "properties": {
        "legal_name": {
          "type": "string"
        },
        "trading_name": {
          "type": "string"
        },
        "lei": {
          "$ref": "#/definitions/Lei"
        },
        "domain": {
          "$ref": "#/definitions/DomainName"
        },
        "mcp_url": {
          "$ref": "#/definitions/Url",
          "description": "MCP endpoint of the server: the `url` of the `apis` entry of type \"mcp\" in `poppy.json`."
        },
        "poppy_url": {
          "$ref": "#/definitions/Url",
          "description": "URL of the PAP `poppy.json` of the domain."
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DistributorRole"
          }
        },
        "conformance_level": {
          "$ref": "#/definitions/ConformanceLevel"
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProductLine"
          },
          "description": "Lines the server can quote, as it declares them."
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          },
          "description": "Countries where the server sells, as it declares them."
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubdivisionCode"
          },
          "description": "Subdivisions of the country asked where the server holds a licence. Omit when its licence covers the whole country."
        },
        "insured_families": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InsuredFamily"
          },
          "description": "Families of the insured in the underwriting scopes of its products."
        },
        "licence_check": {
          "$ref": "#/definitions/ListingCheck"
        },
        "listed_since": {
          "$ref": "#/definitions/DateString",
          "description": "Date when the registry first listed the server."
        }
      },
      "required": [
        "legal_name",
        "domain",
        "mcp_url",
        "poppy_url",
        "roles",
        "conformance_level",
        "lines",
        "countries",
        "licence_check",
        "listed_since"
      ],
      "additionalProperties": false,
      "description": "A server that the registry lists."
    },
    "ListingCheck": {
      "type": "object",
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RegisterIdentifier"
          },
          "description": "The register entries that make the server licensed in the country asked.",
          "minItems": 1
        },
        "checked_at": {
          "$ref": "#/definitions/DateTimeString",
          "description": "When the registry last read these entries in their registers."
        }
      },
      "required": [
        "entries",
        "checked_at"
      ],
      "additionalProperties": false,
      "description": "The last licence check of a listed server, for the country asked."
    },
    "Money": {
      "type": "object",
      "properties": {
        "amount": {
          "$ref": "#/definitions/Decimal"
        },
        "currency": {
          "$ref": "#/definitions/CurrencyCode"
        }
      },
      "required": [
        "amount",
        "currency"
      ],
      "additionalProperties": false
    },
    "NeedsAssessment": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "demands_and_needs"
        },
        "statement": {
          "type": "string",
          "description": "The need in the customer's words or a faithful summary."
        },
        "advice_given": {
          "type": "boolean",
          "description": "True when the distributor gave a personal recommendation (advice)."
        },
        "advice_rationale": {
          "type": "string",
          "description": "Why the recommended offer meets the need. Required when `advice_given` is true."
        },
        "recorded_at": {
          "$ref": "#/definitions/DateTimeString"
        }
      },
      "required": [
        "kind",
        "statement",
        "advice_given",
        "recorded_at"
      ],
      "additionalProperties": false,
      "description": "Demands and needs, recorded before the contract is concluded (IDD Art. 20(1))."
    },
    "NoOffer": {
      "type": "object",
      "properties": {
        "reason_code": {
          "$ref": "#/definitions/NoOfferReason"
        },
        "message": {
          "type": "string",
          "description": "Plain-language explanation the agent can pass to the customer."
        }
      },
      "required": [
        "reason_code",
        "message"
      ],
      "additionalProperties": false,
      "description": "Why no offer is possible."
    },
    "NoOfferReason": {
      "type": "string",
      "description": "Stable reason why no offer is possible. Servers SHOULD use a value of `KnownNoOfferReason`. Other values MUST be lower case with underscores.",
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "NotLicensedReason": {
      "type": "string",
      "enum": [
        "no_entry",
        "licence_not_active",
        "name_mismatch",
        "role_not_covered",
        "subdivision_not_covered",
        "line_not_covered"
      ],
      "description": "Why a party holds no licence for what the agent asked."
    },
    "Offer": {
      "type": "object",
      "properties": {
        "offer_id": {
          "type": "string"
        },
        "product_id": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "description": "Name of the tier or plan, for example \"Terceros Ampliado\" or \"Band B\"."
        },
        "provider": {
          "$ref": "#/definitions/ProviderRef"
        },
        "underwriting_scope_version": {
          "type": "string",
          "description": "Version of the product's underwriting scope that the server applied."
        },
        "pricing": {
          "$ref": "#/definitions/Pricing",
          "description": "The price and the cover. A binding offer MUST give `cover.excess` and `cover.limits`. An empty `limits` means that the cover has no limit."
        },
        "indicative": {
          "type": "boolean",
          "description": "True when the offer is indicative and can change after checks. False makes the offer binding. A server MUST NOT return a binding offer unless the quote carries the customer's validation of its answers and sources."
        },
        "valid_until": {
          "$ref": "#/definitions/DateTimeString",
          "description": "Last moment the offer can be accepted at this price."
        },
        "subscription_paths": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubscriptionPath"
          }
        },
        "handoff_url": {
          "$ref": "#/definitions/Url",
          "description": "Page where the customer can continue with this exact offer. Required when `subscription_paths` contains `handoff`. It MUST NOT contain personal data."
        },
        "recommended": {
          "type": "boolean",
          "description": "True when the distributor recommends this offer after advice."
        }
      },
      "required": [
        "offer_id",
        "product_id",
        "provider",
        "underwriting_scope_version",
        "pricing",
        "indicative",
        "valid_until",
        "subscription_paths"
      ],
      "additionalProperties": false,
      "description": "One priced offer. A distributor can return several offers: one per tier, per provider, or per duration.\n\nWhen a server implements `quote`, an agent MUST take the price, the cover, the limits and the excess that it shows the customer from the offer, and MUST NOT take them from a page made for people."
    },
    "Operation<ApplicationTerms>": {
      "type": "object",
      "properties": {
        "operation_id": {
          "type": "string"
        },
        "revision": {
          "type": "number",
          "description": "Starts at 1. Increases when the terms change. Only the latest revision can be confirmed."
        },
        "state": {
          "$ref": "#/definitions/OperationState"
        },
        "summary": {
          "type": "string",
          "description": "Plain-language terms that the customer can decide from alone."
        },
        "terms": {
          "$ref": "#/definitions/ApplicationTerms"
        },
        "expires_at": {
          "$ref": "#/definitions/DateTimeString",
          "description": "Required while `proposed`."
        },
        "user_approval_required": {
          "type": "boolean",
          "description": "When true, a standing permission is not enough. The customer MUST approve this revision."
        },
        "url": {
          "$ref": "#/definitions/Url"
        },
        "confirmation": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "revision": {
                  "type": "number"
                },
                "approved_by": {
                  "type": "string",
                  "enum": [
                    "user",
                    "standing_permission"
                  ]
                },
                "confirmed_at": {
                  "$ref": "#/definitions/DateTimeString"
                }
              },
              "required": [
                "revision",
                "approved_by",
                "confirmed_at"
              ],
              "additionalProperties": false
            }
          ]
        },
        "result": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "data": {
                  "type": "object",
                  "additionalProperties": {}
                }
              },
              "required": [
                "summary"
              ],
              "additionalProperties": false
            }
          ]
        },
        "aip_progress": {
          "$ref": "#/definitions/AipProgress",
          "description": "AIP reason why the operation is `in_progress`. Not a PAP field. Clients that do not know AIP ignore it."
        }
      },
      "required": [
        "operation_id",
        "revision",
        "state",
        "summary",
        "terms",
        "user_approval_required",
        "confirmation",
        "result"
      ],
      "additionalProperties": false,
      "description": "A PAP operation. This mirrors the PAP operations extension (version 1). PAP is the authority for every field here except `terms` and `aip_progress`. When the two differ, PAP wins.\n\nAn MCP tool returns it in `structuredContent.operation`. The agent confirms it at the PAP operations endpoint, never through an AIP tool."
    },
    "Operation<ValidationTerms>": {
      "type": "object",
      "properties": {
        "operation_id": {
          "type": "string"
        },
        "revision": {
          "type": "number",
          "description": "Starts at 1. Increases when the terms change. Only the latest revision can be confirmed."
        },
        "state": {
          "$ref": "#/definitions/OperationState"
        },
        "summary": {
          "type": "string",
          "description": "Plain-language terms that the customer can decide from alone."
        },
        "terms": {
          "$ref": "#/definitions/ValidationTerms"
        },
        "expires_at": {
          "$ref": "#/definitions/DateTimeString",
          "description": "Required while `proposed`."
        },
        "user_approval_required": {
          "type": "boolean",
          "description": "When true, a standing permission is not enough. The customer MUST approve this revision."
        },
        "url": {
          "$ref": "#/definitions/Url"
        },
        "confirmation": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "revision": {
                  "type": "number"
                },
                "approved_by": {
                  "type": "string",
                  "enum": [
                    "user",
                    "standing_permission"
                  ]
                },
                "confirmed_at": {
                  "$ref": "#/definitions/DateTimeString"
                }
              },
              "required": [
                "revision",
                "approved_by",
                "confirmed_at"
              ],
              "additionalProperties": false
            }
          ]
        },
        "result": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "data": {
                  "type": "object",
                  "additionalProperties": {}
                }
              },
              "required": [
                "summary"
              ],
              "additionalProperties": false
            }
          ]
        },
        "aip_progress": {
          "$ref": "#/definitions/AipProgress",
          "description": "AIP reason why the operation is `in_progress`. Not a PAP field. Clients that do not know AIP ignore it."
        }
      },
      "required": [
        "operation_id",
        "revision",
        "state",
        "summary",
        "terms",
        "user_approval_required",
        "confirmation",
        "result"
      ],
      "additionalProperties": false,
      "description": "A PAP operation. This mirrors the PAP operations extension (version 1). PAP is the authority for every field here except `terms` and `aip_progress`. When the two differ, PAP wins.\n\nAn MCP tool returns it in `structuredContent.operation`. The agent confirms it at the PAP operations endpoint, never through an AIP tool."
    },
    "OperationState": {
      "type": "string",
      "enum": [
        "proposed",
        "in_progress",
        "succeeded",
        "failed",
        "cancelled",
        "expired"
      ]
    },
    "Party": {
      "type": "object",
      "properties": {
        "party_ref": {
          "type": "string",
          "description": "Local reference, unique in one application."
        },
        "kind": {
          "type": "string",
          "enum": [
            "person",
            "organisation"
          ]
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PartyRole"
          }
        },
        "display_name": {
          "type": "string"
        },
        "relationship_to_subscriber": {
          "type": "string",
          "description": "Relationship to the subscriber, for example \"self\", \"spouse\", \"child\", \"employee\"."
        },
        "date_of_birth": {
          "$ref": "#/definitions/DateString"
        },
        "country_of_residence": {
          "$ref": "#/definitions/CountryCode"
        }
      },
      "required": [
        "party_ref",
        "kind",
        "roles",
        "display_name"
      ],
      "additionalProperties": false,
      "description": "A person or organisation in the agreement. Data in a party MUST be limited to what the product needs. Identity numbers MUST NOT be here (see `CollectedBy`)."
    },
    "PartyRole": {
      "type": "string",
      "enum": [
        "subscriber",
        "payer",
        "insured",
        "beneficiary"
      ],
      "description": "Role of a party in the agreement."
    },
    "Premium": {
      "type": "object",
      "properties": {
        "amount": {
          "$ref": "#/definitions/Money"
        },
        "period": {
          "$ref": "#/definitions/PremiumPeriod"
        },
        "taxes_included": {
          "type": "boolean",
          "description": "True when taxes and mandatory levies are in `amount`."
        }
      },
      "required": [
        "amount",
        "period",
        "taxes_included"
      ],
      "additionalProperties": false
    },
    "PremiumPeriod": {
      "type": "string",
      "enum": [
        "month",
        "quarter",
        "half_year",
        "year",
        "single"
      ]
    },
    "Pricing": {
      "type": "object",
      "properties": {
        "premium": {
          "$ref": "#/definitions/Premium"
        },
        "alternative_premiums": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Premium"
          },
          "description": "The same price for another period, when the server can give it."
        },
        "cover": {
          "$ref": "#/definitions/CoverSummary"
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProductOption"
          }
        },
        "start_date": {
          "$ref": "#/definitions/DateString"
        }
      },
      "required": [
        "premium",
        "cover"
      ],
      "additionalProperties": false,
      "description": "The price of an offer, and the cover it buys."
    },
    "Product": {
      "type": "object",
      "properties": {
        "product_id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "line": {
          "$ref": "#/definitions/ProductLine"
        },
        "provider": {
          "$ref": "#/definitions/ProviderRef",
          "description": "Provider of the product, when it is not the distributor."
        },
        "underwriting_scope": {
          "$ref": "#/definitions/UnderwritingScope",
          "description": "The risks the product can cover. A product MUST publish it."
        },
        "summary": {
          "type": "string"
        },
        "details": {
          "$ref": "#/definitions/ProductDetails"
        },
        "subscription_paths": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubscriptionPath"
          }
        }
      },
      "required": [
        "product_id",
        "name",
        "line",
        "underwriting_scope",
        "summary",
        "details",
        "subscription_paths"
      ],
      "additionalProperties": false
    },
    "ProductDetails": {
      "type": "object",
      "properties": {
        "cover": {
          "$ref": "#/definitions/CoverSummary"
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProductOption"
          }
        }
      },
      "required": [
        "cover"
      ],
      "additionalProperties": false,
      "description": "What the product covers, and the options a customer can add."
    },
    "ProductLine": {
      "type": "string",
      "description": "Product line. Servers SHOULD use a value of `KnownProductLine`. Other values MUST be lower case with underscores.",
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "ProductOption": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "price": {
          "anyOf": [
            {
              "$ref": "#/definitions/Premium"
            },
            {
              "$ref": "#/definitions/Money"
            }
          ],
          "description": "Cost of the option, in the same form as the main price."
        }
      },
      "required": [
        "key",
        "label"
      ],
      "additionalProperties": false,
      "description": "An option the customer can add (optional cover, extra service)."
    },
    "ProviderCheckParams": {
      "type": "object",
      "properties": {
        "capacity": {
          "type": "string",
          "const": "provider"
        },
        "subject": {
          "$ref": "#/definitions/ProviderSubject"
        },
        "country": {
          "$ref": "#/definitions/CountryCode",
          "description": "Country where the customer buys."
        },
        "subdivision": {
          "$ref": "#/definitions/SubdivisionCode",
          "description": "Subdivision where the customer buys. REQUIRED for a country in `PER_SUBDIVISION_COUNTRIES`, such as the United States."
        },
        "line": {
          "$ref": "#/definitions/ProductLine"
        }
      },
      "required": [
        "capacity",
        "subject",
        "country"
      ],
      "additionalProperties": false,
      "description": "Params of `verify_licence` for the party that carries the risk, for example the insurer in `Offer.provider`. Only a provider role counts."
    },
    "ProviderRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "legal_name": {
          "type": "string"
        },
        "role": {
          "$ref": "#/definitions/ProviderRole"
        },
        "domain": {
          "type": "string",
          "description": "Domain the provider controls, so that an agent can find it in the registry."
        },
        "lei": {
          "$ref": "#/definitions/Lei",
          "description": "Legal Entity Identifier, when the provider has one."
        },
        "licences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Licence"
          },
          "description": "The register entries that allow the provider to carry the risk, for example its authorisation as an insurer. At least one.",
          "minItems": 1
        }
      },
      "required": [
        "name",
        "role",
        "licences"
      ],
      "additionalProperties": false,
      "description": "The party that carries the risk."
    },
    "ProviderRole": {
      "type": "string",
      "const": "insurer",
      "description": "Role of the party that carries the risk."
    },
    "ProviderSubject": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "domain": {
              "$ref": "#/definitions/DomainName",
              "description": "Domain of the provider, for example `ProviderRef.domain`."
            },
            "identifier": {
              "$ref": "#/definitions/RegisterIdentifier",
              "description": "Register entry of the provider, for example one of `ProviderRef.licences`."
            },
            "legal_name": {
              "type": "string",
              "description": "Legal name of the provider, for example `ProviderRef.legal_name`."
            }
          },
          "required": [
            "domain"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "identifier": {
              "$ref": "#/definitions/RegisterIdentifier",
              "description": "Register entry of the provider, for example one of `ProviderRef.licences`."
            },
            "legal_name": {
              "type": "string",
              "description": "Legal name of the provider, for example `ProviderRef.legal_name`."
            }
          },
          "required": [
            "identifier"
          ],
          "additionalProperties": false
        }
      ],
      "description": "A provider to check, for example from `Offer.provider`. Give its domain, a register entry, or both."
    },
    "QuestionSet": {
      "type": "object",
      "properties": {
        "question_set_id": {
          "type": "string"
        },
        "version": {
          "type": "string",
          "description": "Version of this question set. A change in any question MUST change it."
        },
        "product_id": {
          "type": "string"
        },
        "line": {
          "$ref": "#/definitions/ProductLine"
        },
        "profile": {
          "type": "string",
          "description": "Line profile and version this question set builds on, for example \"pet@0.1\"."
        },
        "answers_schema": {
          "$ref": "#/definitions/AnswersSchema"
        }
      },
      "required": [
        "question_set_id",
        "version",
        "product_id",
        "line",
        "answers_schema"
      ],
      "additionalProperties": false
    },
    "QuestionSetRef": {
      "type": "object",
      "properties": {
        "question_set_id": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "question_set_id",
        "version"
      ],
      "additionalProperties": false
    },
    "QuoteParams": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "product_id": {
              "type": "string"
            },
            "question_set": {
              "$ref": "#/definitions/QuestionSetRef"
            },
            "answers": {
              "$ref": "#/definitions/Answers"
            },
            "answer_sources": {
              "$ref": "#/definitions/AnswerSources",
              "description": "Where each answer comes from, keyed like `answers`."
            },
            "validation": {
              "$ref": "#/definitions/AnswersValidation",
              "description": "The customer's validation of these answers and sources, from a succeeded `validate_answers` operation. When it does not match them, the server returns `answers_not_validated`."
            },
            "options": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Options the customer wants priced, by key (optional covers, extra services)."
            },
            "language": {
              "$ref": "#/definitions/LanguageTag"
            }
          },
          "required": [
            "product_id",
            "question_set",
            "answers",
            "answer_sources"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "quote_request_id": {
              "type": "string"
            }
          },
          "required": [
            "quote_request_id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Params of `quote`.\n\nThe agent MAY send partial answers. The server then returns `needs_input` with the missing fields, and the agent calls `quote` again with more answers. This one loop replaces the multi-step flow tools (`action`, `stateUpdates`, `sessionId`) that most servers use. Some servers already work this way.\n\nWithout `validation`, every offer is indicative. To get binding offers, the agent first has the customer validate the answers with `validate_answers`, then sends the same answers and sources with that `validation`.\n\nTo read a quote that is still in progress, send only `quote_request_id`."
    },
    "QuoteResult": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "const": "complete"
            },
            "quote_request_id": {
              "type": "string"
            },
            "question_set": {
              "$ref": "#/definitions/QuestionSetRef"
            },
            "answers_sha256": {
              "$ref": "#/definitions/Sha256",
              "description": "SHA-256 of the canonical JSON (RFC 8785) of the answers used."
            },
            "answer_sources_sha256": {
              "$ref": "#/definitions/Sha256",
              "description": "SHA-256 of the canonical JSON (RFC 8785) of the answer sources used."
            },
            "validation": {
              "$ref": "#/definitions/AnswersValidation",
              "description": "The validation the server applied. Required when an offer is binding."
            },
            "offers": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Offer"
              }
            },
            "no_offer": {
              "$ref": "#/definitions/NoOffer",
              "description": "Required when `offers` is empty."
            }
          },
          "required": [
            "status",
            "quote_request_id",
            "question_set",
            "answers_sha256",
            "answer_sources_sha256",
            "offers"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "const": "needs_input"
            },
            "quote_request_id": {
              "type": "string"
            },
            "missing_fields": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/FieldIssue"
              },
              "description": "Properties of `answers_schema` that are missing or not valid."
            }
          },
          "required": [
            "status",
            "quote_request_id",
            "missing_fields"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "const": "in_progress"
            },
            "quote_request_id": {
              "type": "string"
            },
            "retry_after_seconds": {
              "type": "number",
              "description": "When the agent SHOULD read the quote again."
            },
            "message": {
              "type": "string",
              "description": "Plain-language status, for example \"Two insurers have answered, three to go\"."
            }
          },
          "required": [
            "status",
            "quote_request_id",
            "retry_after_seconds"
          ],
          "additionalProperties": false
        }
      ]
    },
    "RegisterCoverage": {
      "type": "string",
      "enum": [
        "intermediaries",
        "insurers"
      ],
      "description": "The kind of party that a register lists."
    },
    "RegisterIdentifier": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode",
          "description": "Country of the register."
        },
        "identifier_type": {
          "$ref": "#/definitions/RegisterIdentifierType"
        },
        "identifier": {
          "type": "string"
        },
        "register": {
          "type": "string",
          "description": "Name of the register. Give it when `identifier_type` is \"other\"."
        }
      },
      "required": [
        "country",
        "identifier_type",
        "identifier"
      ],
      "additionalProperties": false,
      "description": "An entry in a public register, as an agent or a listing gives it."
    },
    "RegisterIdentifierType": {
      "type": "string",
      "enum": [
        "orias_number",
        "siren",
        "fca_frn",
        "npn",
        "dgsfp_key",
        "naic_cocode",
        "lei",
        "other"
      ],
      "description": "Kind of public register identifier."
    },
    "RegisterSource": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode"
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubdivisionCode"
          },
          "description": "Subdivisions that this source covers, for example one US state. Omit when it covers the whole country."
        },
        "register": {
          "type": "string",
          "description": "Name of the register, for example \"ORIAS\" or \"FCA Register\"."
        },
        "regulator": {
          "type": "string",
          "description": "Authority that keeps the register, or that supervises its entries."
        },
        "covers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RegisterCoverage"
          }
        },
        "identifier_type": {
          "$ref": "#/definitions/RegisterIdentifierType"
        },
        "access": {
          "$ref": "#/definitions/SourceAccess"
        },
        "url": {
          "$ref": "#/definitions/Url",
          "description": "Public home page of the register."
        }
      },
      "required": [
        "country",
        "register",
        "regulator",
        "covers",
        "identifier_type",
        "access",
        "url"
      ],
      "additionalProperties": false,
      "description": "A public register that the registry reads."
    },
    "RegistryError": {
      "type": "object",
      "properties": {
        "code": {
          "$ref": "#/definitions/RegistryErrorCode"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false,
      "description": "Error returned in an MCP tool result with `isError: true`, in `structuredContent.error`.\n\nA registry tool MUST refuse a call with a param that this file does not define, and MUST NOT keep its value. That is how the registry stays free of customer data."
    },
    "RegistryErrorCode": {
      "type": "string",
      "enum": [
        "country_not_covered",
        "invalid_params"
      ]
    },
    "RegistrySettings": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Protocol version the registry implements."
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          },
          "description": "Countries where the registry checks licences and lists servers."
        },
        "rules_countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CountryCode"
          },
          "description": "Countries that have a rules file in `get_country_rules`."
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RegisterSource"
          },
          "description": "Every public register the registry reads."
        },
        "policy_url": {
          "$ref": "#/definitions/Url",
          "description": "Page where the operator publishes how it lists servers, how it checks licences, how it maps register categories to lines, and how to reach it."
        }
      },
      "required": [
        "version",
        "countries",
        "rules_countries",
        "sources",
        "policy_url"
      ],
      "additionalProperties": false,
      "description": "Settings object of the registry extension. The registry puts it under `capabilities.extensions[\"org.agenticinsuranceprotocol/registry\"]` in its MCP `server/discover` response.\n\nThe registry SHOULD also serve the buyer skill through the MCP Skills extension (`io.modelcontextprotocol/skills`). An agent whose host loads skills over MCP then gets the whole skill from the registry, and `get_country_rules` serves the same country files to the other agents."
    },
    "RegistryToolName": {
      "type": "string",
      "enum": [
        "search_distributors",
        "verify_licence",
        "get_country_rules"
      ]
    },
    "RegistryToolSignatures": {
      "type": "object",
      "properties": {
        "search_distributors": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/SearchDistributorsParams"
            },
            "result": {
              "$ref": "#/definitions/SearchDistributorsResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "verify_licence": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/VerifyLicenceParams"
            },
            "result": {
              "$ref": "#/definitions/VerifyLicenceResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "get_country_rules": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/GetCountryRulesParams"
            },
            "result": {
              "$ref": "#/definitions/GetCountryRulesResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "search_distributors",
        "verify_licence",
        "get_country_rules"
      ],
      "additionalProperties": false,
      "description": "Params and result type of each registry tool."
    },
    "RulesFile": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode"
        },
        "subdivision": {
          "$ref": "#/definitions/SubdivisionCode",
          "description": "Present for the file of a subdivision."
        },
        "line": {
          "$ref": "#/definitions/ProductLine",
          "description": "Present for the file of a line."
        },
        "version": {
          "type": "string",
          "description": "Version of the file. A change in the text MUST change it."
        },
        "owner": {
          "type": "string",
          "description": "Who maintains the file: the AIP maintainers, until a regulator takes it over."
        },
        "status": {
          "$ref": "#/definitions/RulesStatus"
        },
        "endorsed_by": {
          "type": "string",
          "description": "Regulator that endorsed this version. REQUIRED when `status` is \"endorsed\"."
        },
        "reviewed_at": {
          "$ref": "#/definitions/DateString",
          "description": "Date of the last legal review. Omit when no review happened."
        },
        "language": {
          "$ref": "#/definitions/LanguageTag"
        },
        "content": {
          "type": "string",
          "description": "The whole file, unchanged, front matter included."
        },
        "sha256": {
          "$ref": "#/definitions/Sha256",
          "description": "SHA-256 of `content` as UTF-8 bytes."
        },
        "url": {
          "$ref": "#/definitions/Url",
          "description": "Public HTTPS address of the same file."
        },
        "skill_uri": {
          "type": "string",
          "description": "URI of the same file in the skill that the registry serves over MCP, when it does."
        }
      },
      "required": [
        "country",
        "version",
        "owner",
        "status",
        "language",
        "content",
        "sha256",
        "url"
      ],
      "additionalProperties": false,
      "description": "One rules file of the buyer skill. The file is Markdown with a YAML front matter. The front matter holds `country`, `version`, `owner`, `status`, and `endorsed_by` and `reviewed_at` when they apply, with the same values as the fields of this object. It also holds `subdivision` and `line` for a file of a subdivision or of a line."
    },
    "RulesStatus": {
      "type": "string",
      "enum": [
        "draft",
        "endorsed"
      ],
      "description": "Review state of a rules file."
    },
    "SearchDistributorsParams": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/CountryCode",
          "description": "Country where the customer buys."
        },
        "subdivision": {
          "$ref": "#/definitions/SubdivisionCode",
          "description": "Subdivision where the customer buys, for example a US state."
        },
        "line": {
          "$ref": "#/definitions/ProductLine"
        },
        "insured_family": {
          "$ref": "#/definitions/InsuredFamily",
          "description": "Family of the insured, as in the underwriting scope of a product, for example \"pet\" or \"dwelling\"."
        },
        "min_conformance_level": {
          "$ref": "#/definitions/ConformanceLevel",
          "description": "Return only servers of this level or above."
        },
        "cursor": {
          "type": "string"
        }
      },
      "required": [
        "country"
      ],
      "additionalProperties": false,
      "description": "Params of `search_distributors`. The params describe a market, never a person."
    },
    "SearchDistributorsResult": {
      "type": "object",
      "properties": {
        "distributors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ListedDistributor"
          }
        },
        "next_cursor": {
          "type": "string"
        }
      },
      "required": [
        "distributors"
      ],
      "additionalProperties": false,
      "description": "Result of `search_distributors`.\n\n- Each server in `distributors` MUST match every param of the search: the   country is in its `countries`, the line is in its `lines`, the subdivision   is in its `subdivisions` when it has some, the insured family is in its   `insured_families`, and its level is not below `min_conformance_level`.\n- The registry MUST return every listed server that matches, across the   pages.\n- For a country where it lists no server, the registry MUST return the error   \"country_not_covered\", so that an agent does not read an empty list as   \"no seller exists\".\n- The order carries no meaning. The registry MUST NOT rank a server for a   payment or for any commercial link. It SHOULD shuffle the order for each   new search, and keep that order across the pages of the same search.\n- An agent MUST NOT show the order to the customer as a ranking.\n- A search result is not a licence check. An agent checks the seller with   `verify_licence` before it sends any of the customer's answers."
    },
    "SellerSubject": {
      "type": "object",
      "properties": {
        "domain": {
          "$ref": "#/definitions/DomainName",
          "description": "Domain of the MCP server or the website that receives the customer's answers."
        },
        "identifier": {
          "$ref": "#/definitions/RegisterIdentifier",
          "description": "Register entry that the seller shows, for example in the legal notice of its website."
        },
        "legal_name": {
          "type": "string",
          "description": "Legal name that the seller shows."
        }
      },
      "required": [
        "domain"
      ],
      "additionalProperties": false,
      "description": "A seller to check. The domain is where the customer's answers go."
    },
    "SessionRequirement": {
      "type": "string",
      "enum": [
        "none",
        "signed_out_or_none"
      ],
      "description": "Session that a tool needs (PAP draft 0.2)."
    },
    "Sha256": {
      "type": "string",
      "description": "Lower-case hex SHA-256 digest.",
      "pattern": "^[a-f0-9]{64}$"
    },
    "SourceAccess": {
      "type": "string",
      "enum": [
        "api",
        "bulk_file",
        "web_page"
      ],
      "description": "How the registry reads a public register. The registry MUST read a register only through an access that the terms of the register allow, and under an agreement when the terms ask for one. Most registers forbid robots on their web pages."
    },
    "SubdivisionCode": {
      "type": "string",
      "description": "ISO 3166-2 subdivision code, upper case, for example \"US-CA\" for California.",
      "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
    },
    "SubmitApplicationParams": {
      "type": "object",
      "properties": {
        "offer_id": {
          "type": "string"
        },
        "parties": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Party"
          }
        },
        "declaration": {
          "$ref": "#/definitions/Declaration"
        },
        "needs_assessment": {
          "$ref": "#/definitions/NeedsAssessment"
        },
        "documents_delivered": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeliveredDocument"
          }
        },
        "contact_consent": {
          "$ref": "#/definitions/ContactConsent"
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "start_date": {
          "$ref": "#/definitions/DateString"
        }
      },
      "required": [
        "offer_id",
        "parties",
        "declaration",
        "needs_assessment",
        "documents_delivered",
        "contact_consent"
      ],
      "additionalProperties": false
    },
    "SubmitApplicationResult": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/definitions/Operation%3CApplicationTerms%3E"
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false,
      "description": "When the operation succeeds, `result.data` holds an `ApplicationOutcome`."
    },
    "SubscriptionPath": {
      "type": "string",
      "enum": [
        "conclude",
        "application",
        "handoff"
      ],
      "description": "How a customer can subscribe to a product."
    },
    "ToolName": {
      "type": "string",
      "enum": [
        "get_distributor",
        "list_products",
        "get_documents",
        "get_question_set",
        "quote",
        "validate_answers",
        "submit_application",
        "conclude"
      ]
    },
    "ToolSignatures": {
      "type": "object",
      "properties": {
        "get_distributor": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/GetDistributorParams"
            },
            "result": {
              "$ref": "#/definitions/GetDistributorResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "list_products": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/ListProductsParams"
            },
            "result": {
              "$ref": "#/definitions/ListProductsResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "get_documents": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/GetDocumentsParams"
            },
            "result": {
              "$ref": "#/definitions/GetDocumentsResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "get_question_set": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/GetQuestionSetParams"
            },
            "result": {
              "$ref": "#/definitions/GetQuestionSetResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "quote": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/QuoteParams"
            },
            "result": {
              "$ref": "#/definitions/QuoteResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "validate_answers": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/ValidateAnswersParams"
            },
            "result": {
              "$ref": "#/definitions/ValidateAnswersResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "submit_application": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/SubmitApplicationParams"
            },
            "result": {
              "$ref": "#/definitions/SubmitApplicationResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        },
        "conclude": {
          "type": "object",
          "properties": {
            "params": {
              "$ref": "#/definitions/ConcludeParams"
            },
            "result": {
              "$ref": "#/definitions/ConcludeResult"
            }
          },
          "required": [
            "params",
            "result"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "get_distributor",
        "list_products",
        "get_documents",
        "get_question_set",
        "quote",
        "validate_answers",
        "submit_application",
        "conclude"
      ],
      "additionalProperties": false,
      "description": "Params and result type of each tool."
    },
    "UnderwritingScope": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of the scope. A change in any part MUST change it."
        },
        "geography": {
          "$ref": "#/definitions/Geography"
        },
        "insured": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InsuredType"
          },
          "description": "What the product insures. At least one.",
          "minItems": 1
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The conditions that a machine cannot check, in plain words, for example \"Houses built after 1950 only\" or \"Not for people over 70\". Empty when there are none. An agent SHOULD check them against what the customer said before it quotes, and ask the customer when it is not sure."
        }
      },
      "required": [
        "version",
        "geography",
        "insured",
        "conditions"
      ],
      "additionalProperties": false,
      "description": "The risks a product can cover. `list_products` gives it with no customer data, so that an agent can drop a product that cannot cover the customer before it asks a question.\n\n`geography` and `insured` are the structured part, which a machine can check against the answers. A server MUST NOT return an offer for a risk outside the structured part. An agent MUST NOT send answers to `quote` for a product whose structured part excludes the customer. `conditions` holds the rest."
    },
    "UnknownReason": {
      "type": "string",
      "enum": [
        "country_not_covered",
        "subdivision_required",
        "register_unavailable",
        "subject_not_identified",
        "domain_not_linked"
      ],
      "description": "Why the registry cannot decide."
    },
    "Url": {
      "type": "string",
      "format": "uri"
    },
    "ValidateAnswersParams": {
      "type": "object",
      "properties": {
        "product_id": {
          "type": "string"
        },
        "question_set": {
          "$ref": "#/definitions/QuestionSetRef"
        },
        "answers": {
          "$ref": "#/definitions/Answers"
        },
        "answer_sources": {
          "$ref": "#/definitions/AnswerSources",
          "description": "Where each answer comes from, keyed like `answers`."
        },
        "language": {
          "$ref": "#/definitions/LanguageTag",
          "description": "Language of the operation `summary`."
        }
      },
      "required": [
        "product_id",
        "question_set",
        "answers",
        "answer_sources"
      ],
      "additionalProperties": false,
      "description": "Params of `validate_answers`. The agent calls it before it asks for binding offers, and before an application. The answers MUST be complete for the question set. Otherwise the server returns `answers_invalid`."
    },
    "ValidateAnswersResult": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/definitions/Operation%3CValidationTerms%3E"
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false,
      "description": "Result of `validate_answers`. The operation MUST have `user_approval_required: true`, because only the customer can validate their answers. The agent MUST ask the person who will be the subscriber to approve it. When it succeeds, `result.data` holds a `ValidationOutcome`."
    },
    "ValidationOutcome": {
      "type": "object",
      "properties": {
        "validation": {
          "$ref": "#/definitions/AnswersValidation"
        }
      },
      "required": [
        "validation"
      ],
      "additionalProperties": false
    },
    "ValidationTerms": {
      "type": "object",
      "properties": {
        "product_id": {
          "type": "string"
        },
        "question_set": {
          "$ref": "#/definitions/QuestionSetRef"
        },
        "answers": {
          "$ref": "#/definitions/Answers"
        },
        "answer_sources": {
          "$ref": "#/definitions/AnswerSources"
        },
        "answers_sha256": {
          "$ref": "#/definitions/Sha256",
          "description": "SHA-256 of the canonical JSON (RFC 8785) of `answers`."
        },
        "answer_sources_sha256": {
          "$ref": "#/definitions/Sha256",
          "description": "SHA-256 of the canonical JSON (RFC 8785) of `answer_sources`."
        }
      },
      "required": [
        "product_id",
        "question_set",
        "answers",
        "answer_sources",
        "answers_sha256",
        "answer_sources_sha256"
      ],
      "additionalProperties": false,
      "description": "Terms of a validation: the answers that the customer validates, and their sources. The `summary` of the operation MUST show each answer and its source in plain words, so that the customer can check each one."
    },
    "VerifyLicenceParams": {
      "anyOf": [
        {
          "$ref": "#/definitions/DistributorCheckParams"
        },
        {
          "$ref": "#/definitions/ProviderCheckParams"
        }
      ],
      "description": "Params of `verify_licence`. The params name a company and a market, never a person. A seller check always names the domain that receives the customer's answers, because a register number alone does not prove who runs a website."
    },
    "VerifyLicenceResult": {
      "type": "object",
      "properties": {
        "check_id": {
          "type": "string",
          "description": "Identifier of this check, set by the registry."
        },
        "params": {
          "$ref": "#/definitions/VerifyLicenceParams",
          "description": "The params of the call, so that the result is a complete record alone."
        },
        "subject": {
          "$ref": "#/definitions/CheckedSubject"
        },
        "licences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LicenceCheck"
          },
          "description": "Every entry the registry read for the party."
        },
        "outcome": {
          "$ref": "#/definitions/LicenceVerdict"
        },
        "checked_at": {
          "$ref": "#/definitions/DateTimeString",
          "description": "When the registry gave the verdict."
        }
      },
      "required": [
        "check_id",
        "params",
        "subject",
        "licences",
        "outcome",
        "checked_at"
      ],
      "additionalProperties": false,
      "description": "Result of `verify_licence`.\n\nThe registry tests each entry in this order. An entry covers the question when it passes all five tests: 1. Country: the entry exists, and its `country` is the country asked or its    `passports` include it. 2. Subdivision: it has no `subdivisions`, or they include the subdivision    asked. 3. Line: it has no `lines`, or no line is asked, or its `lines` include the    line. 4. Role: for the capacity \"provider\", its role is a provider role. 5. Status: its status is \"active\".\n\nThe verdict:\n- \"licensed\" when at least one entry covers the question and, if the params   give a domain, `domain_link` is \"register\" or \"confirmed\".\n- \"unknown\" when no entry covers the question and the registry could not   read every register that applies, or could not identify the party. Also   when an entry covers the question but the domain link is \"claimed\" or   \"not_linked\".\n- \"not_licensed\" in every other case: the registry read every register that   applies, and no entry covers the question. The reason comes from the entry   that passed the most tests, and names the first test it failed: country   \"no_entry\", subdivision \"subdivision_not_covered\", line   \"line_not_covered\", role \"role_not_covered\", status \"name_mismatch\" or   \"licence_not_active\".\n\nRules for the registry:\n- `licences` MUST list every entry that the registry read for the party in   the registers that apply, including the entries that are not active.\n- A verdict MUST rest only on reads made at most `MAX_READ_AGE_DAYS` days   before `checked_at`. The registry SHOULD read the register again for each   call when the register has an API or a web page.\n- The registry SHOULD keep each result under its `check_id` for at least five   years, so that it can confirm later what it said.\n\nRules for the agent:\n- An agent MUST check the seller, in the capacity \"distributor\", before it   sends any of the customer's answers to that seller. The domain MUST be the   domain of the server or the website that receives the answers. The agent   gives the customer's country, the subdivision where licences apply per   subdivision, and SHOULD give the line.\n- An agent MUST check the provider of an offer, in the capacity \"provider\",   before it applies or concludes, when the provider is not the seller.\n- On \"not_licensed\", the agent MUST NOT send the customer's answers to that   party, and MUST NOT apply or conclude through it. It MUST tell the customer   why.\n- On \"unknown\", the agent MUST tell the customer that the licence could not be   checked, and why. It MUST NOT apply or conclude, and SHOULD NOT send the   customer's answers. It MAY ask the seller for its register identifier and   check again.\n- An agent MUST keep each result that it relies on with the record of the   sale, and SHOULD give the customer a copy."
    }
  }
}
