{
  "$id": "https://betterstood.com/developers/v31/schemas/mcp/scenario_review_draft.output.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "additionalProperties": false,
      "properties": {
        "conversationLength": {
          "additionalProperties": false,
          "properties": {
            "state": {
              "enum": [
                "ok",
                "near_limit",
                "too_long"
              ],
              "type": "string"
            },
            "suggestions": {
              "items": {
                "additionalProperties": false,
                "properties": {
                  "fieldKey": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "reason": {
                    "enum": [
                      "shorten_question",
                      "reduce_examples",
                      "shorten_instructions",
                      "split_scenario"
                    ],
                    "type": "string"
                  },
                  "section": {
                    "enum": [
                      "elicitation-fields",
                      "agent-conversation",
                      "basics",
                      "knowledge-base",
                      "appointments",
                      "live-fit"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "section",
                  "reason"
                ],
                "type": "object"
              },
              "maxItems": 5,
              "type": "array"
            },
            "supportCode": {
              "anyOf": [
                {
                  "enum": [
                    "BS-SCENARIO-001",
                    "BS-SCENARIO-002"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "state",
            "supportCode",
            "suggestions"
          ],
          "type": "object"
        },
        "interviewEstimate": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "capacity": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "availableCredits": {
                          "maximum": 9007199254740991,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "interviews": {
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "channel": {
                                "enum": [
                                  "web_call",
                                  "phone_call",
                                  "text_chat"
                                ],
                                "type": "string"
                              },
                              "count": {
                                "anyOf": [
                                  {
                                    "maximum": 9007199254740991,
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "channel",
                              "count"
                            ],
                            "type": "object"
                          },
                          "maxItems": 3,
                          "type": "array"
                        }
                      },
                      "required": [
                        "availableCredits",
                        "interviews"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "channels": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "channel": {
                        "enum": [
                          "web_call",
                          "phone_call",
                          "text_chat"
                        ],
                        "type": "string"
                      },
                      "heldCredits": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "highCredits": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "typicalCredits": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "withinLimit": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "channel",
                      "typicalCredits",
                      "highCredits",
                      "heldCredits",
                      "withinLimit"
                    ],
                    "type": "object"
                  },
                  "maxItems": 3,
                  "type": "array"
                },
                "duration": {
                  "enum": [
                    "ok",
                    "long",
                    "near_voice_limit",
                    "over_voice_limit"
                  ],
                  "type": "string"
                },
                "minutes": {
                  "additionalProperties": false,
                  "properties": {
                    "high": {
                      "exclusiveMinimum": 0,
                      "maximum": 1440,
                      "type": "integer"
                    },
                    "low": {
                      "exclusiveMinimum": 0,
                      "maximum": 1440,
                      "type": "integer"
                    },
                    "typical": {
                      "exclusiveMinimum": 0,
                      "maximum": 1440,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "low",
                    "typical",
                    "high"
                  ],
                  "type": "object"
                },
                "questions": {
                  "additionalProperties": false,
                  "properties": {
                    "conversation": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "formFirst": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "optional": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "required": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "conversation",
                    "required",
                    "optional",
                    "formFirst"
                  ],
                  "type": "object"
                },
                "version": {
                  "const": "interview-estimate.v1",
                  "type": "string"
                },
                "voiceLimitMinutes": {
                  "exclusiveMinimum": 0,
                  "maximum": 1440,
                  "type": "integer"
                }
              },
              "required": [
                "version",
                "questions",
                "minutes",
                "voiceLimitMinutes",
                "duration",
                "channels",
                "capacity"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "issues": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "maxLength": 128,
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "promptPreview": {
          "maxLength": 100000,
          "type": "string"
        },
        "ready": {
          "type": "boolean"
        },
        "revision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "scenarioId": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        "studioUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "warnings": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "maxLength": 128,
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": [
        "scenarioId",
        "revision",
        "ready",
        "issues",
        "warnings",
        "interviewEstimate",
        "promptPreview",
        "studioUrl"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "NOT_FOUND",
            "REVISION_CONFLICT",
            "RESOURCE_LOCKED",
            "SCENARIO_LOCKED",
            "CAMPAIGN_LOCKED",
            "VALIDATION_FAILED",
            "QUOTA_EXCEEDED",
            "TOOL_NOT_AVAILABLE",
            "IDEMPOTENCY_KEY_REUSED",
            "REMOVAL_ACKNOWLEDGEMENT_REQUIRED",
            "UNAUTHORIZED",
            "FORBIDDEN",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE"
          ],
          "type": "string"
        },
        "currentRevision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "docsUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "editorUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "expectedRevision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "field": {
          "maxLength": 256,
          "type": "string"
        },
        "issues": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "maxLength": 128,
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "maxItems": 100,
          "type": "array"
        },
        "message": {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "studioUrl": {
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "type": "object"
    }
  ],
  "title": "scenario_review_draft output",
  "type": "object"
}
