{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "assess_master_data_quality tool input",
  "description": "Input for the paid quality assessment of ONE stored golden record or ONE submitted attribute set. Mirrors POST /v1/master-data/data-quality/assess. Exactly one of record_id or attributes is supplied, per BUILD.md 8.8; the semantics are implemented in crates/core/src/operations/quality.rs. Submitted attributes are assessed without being written, and only their digest is ever echoed back.",
  "type": "object",
  "required": [
    "entity_type"
  ],
  "additionalProperties": false,
  "properties": {
    "entity_type": {
      "$ref": "#/$defs/entityType"
    },
    "record_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "description": "Existing golden-record ID to assess. Supply this or attributes, never both."
    },
    "attributes": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 50,
      "description": "Candidate attributes to assess without writing them. Supply this or record_id, never both. No value submitted here is stored, published, or echoed: the answer names the input by its digest alone.",
      "additionalProperties": {
        "type": [
          "string",
          "number",
          "integer",
          "boolean",
          "null"
        ]
      }
    },
    "dimensions": {
      "type": "array",
      "uniqueItems": true,
      "default": [
        "completeness",
        "validity",
        "consistency",
        "uniqueness",
        "freshness"
      ],
      "description": "The quality dimensions to assess. A registered rule scoring a dimension not asked for is absent from the answer's issues, passed_rules, and not_evaluated_rules alike.",
      "items": {
        "$ref": "#/$defs/qualityDimension"
      }
    },
    "include_remediation_guidance": {
      "type": "boolean",
      "default": true,
      "description": "Whether each reported issue carries remediation guidance."
    }
  },
  "oneOf": [
    {
      "required": [
        "record_id"
      ]
    },
    {
      "required": [
        "attributes"
      ]
    }
  ],
  "$defs": {
    "entityType": {
      "description": "One of the v1 entity domains. customer, asset, and person are closed Operator decisions, not gaps; reference data is served by get_reference_data.",
      "enum": [
        "supplier",
        "location",
        "organization"
      ]
    },
    "qualityDimension": {
      "description": "The quality dimensions the serving snapshot scores. Exactly the five the snapshot's quality object carries and the quality_rules registry may name.",
      "enum": [
        "completeness",
        "validity",
        "consistency",
        "uniqueness",
        "freshness"
      ]
    }
  }
}
