{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.2/bridging/agentErrorResponse.schema.json",
  "title": "Agent Error Response Message",
  "type": "object",
  "description": "A response message from a Desktop Agent to the Bridge containing an error, to be used in preference to the standard response when an error needs to be returned.",
  "properties": {
    "type": {
      "title": "Response Message Type",
      "type": "string",
      "enum": [
        "findInstancesResponse",
        "findIntentResponse",
        "findIntentsByContextResponse",
        "getAppMetadataResponse",
        "openResponse",
        "raiseIntentResponse",
        "raiseIntentResultResponse"
      ],
      "description": "Identifies the type of the message and it is typically set to the FDC3 function name that the message relates to, e.g. 'findIntent', with 'Response' appended."
    },
    "payload": {
      "title": "Error Response Message Payload",
      "type": "object",
      "description": "Error message payload containing an standardized error string.",
      "properties": {
        "error": {
          "$ref": "../api/common.schema.json#/$defs/ErrorMessages"
        }
      },
      "unevaluatedProperties": false,
      "required": ["error"]
    },
    "meta": {
      "$ref": "agentResponse.schema.json#/$defs/AgentResponseMeta"
    }
  },
  "additionalProperties": false,
  "required": ["type", "payload", "meta"]
}
