{
  "$defs": {
    "DynamicLimits": {
      "additionalProperties": false,
      "properties": {
        "max_depth": {
          "maximum": 3,
          "minimum": 1,
          "title": "Max Depth",
          "type": "integer"
        },
        "max_fields": {
          "minimum": 1,
          "title": "Max Fields",
          "type": "integer"
        },
        "max_items": {
          "minimum": 1,
          "title": "Max Items",
          "type": "integer"
        },
        "max_text_length": {
          "minimum": 1,
          "title": "Max Text Length",
          "type": "integer"
        }
      },
      "required": [
        "max_fields",
        "max_depth",
        "max_text_length",
        "max_items"
      ],
      "title": "DynamicLimits",
      "type": "object"
    },
    "Effect": {
      "enum": [
        "read",
        "write",
        "external"
      ],
      "title": "Effect",
      "type": "string"
    },
    "FieldDecl": {
      "additionalProperties": false,
      "properties": {
        "description": {
          "minLength": 1,
          "title": "Description",
          "type": "string"
        },
        "enum": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Enum"
        },
        "maxItems": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Maxitems"
        },
        "maxLength": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Maxlength"
        },
        "maximum": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Maximum"
        },
        "minimum": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Minimum"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Pattern"
        },
        "type": {
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "name",
        "type",
        "description"
      ],
      "title": "FieldDecl",
      "type": "object"
    },
    "JobWaitSpec": {
      "additionalProperties": false,
      "properties": {
        "interval_seconds": {
          "minimum": 1,
          "title": "Interval Seconds",
          "type": "integer"
        },
        "poll": {
          "title": "Poll",
          "type": "string"
        },
        "timeout_seconds": {
          "minimum": 1,
          "title": "Timeout Seconds",
          "type": "integer"
        }
      },
      "required": [
        "poll",
        "interval_seconds",
        "timeout_seconds"
      ],
      "title": "JobWaitSpec",
      "type": "object"
    },
    "McpToolSource": {
      "additionalProperties": false,
      "properties": {
        "server": {
          "title": "Server",
          "type": "string"
        },
        "tool": {
          "minLength": 1,
          "title": "Tool",
          "type": "string"
        }
      },
      "required": [
        "server",
        "tool"
      ],
      "title": "McpToolSource",
      "type": "object"
    },
    "OutputField": {
      "additionalProperties": false,
      "properties": {
        "description": {
          "minLength": 1,
          "title": "Description",
          "type": "string"
        },
        "enum": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Enum"
        },
        "limits": {
          "anyOf": [
            {
              "$ref": "#/$defs/DynamicLimits"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "maxItems": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Maxitems"
        },
        "maxLength": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Maxlength"
        },
        "maximum": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Maximum"
        },
        "minimum": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Minimum"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Pattern"
        },
        "schema_from": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Schema From"
        },
        "type": {
          "title": "Type",
          "type": "string"
        },
        "value_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Value Type"
        }
      },
      "required": [
        "name",
        "type",
        "description"
      ],
      "title": "OutputField",
      "type": "object"
    },
    "SecretBinding": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "ref": {
          "title": "Ref",
          "type": "string"
        }
      },
      "required": [
        "name",
        "ref"
      ],
      "title": "SecretBinding",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "apiVersion": {
      "const": "aqven/v1",
      "title": "Apiversion",
      "type": "string"
    },
    "description": {
      "minLength": 1,
      "title": "Description",
      "type": "string"
    },
    "effect": {
      "$ref": "#/$defs/Effect"
    },
    "idempotency_key": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Idempotency Key"
    },
    "in": {
      "items": {
        "$ref": "#/$defs/FieldDecl"
      },
      "title": "In",
      "type": "array"
    },
    "kind": {
      "const": "Tool",
      "title": "Kind",
      "type": "string"
    },
    "mcp": {
      "anyOf": [
        {
          "$ref": "#/$defs/McpToolSource"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "out": {
      "items": {
        "$ref": "#/$defs/OutputField"
      },
      "title": "Out",
      "type": "array"
    },
    "run": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Run"
    },
    "secrets": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/SecretBinding"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Secrets"
    },
    "wait": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobWaitSpec"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "apiVersion",
    "kind",
    "description",
    "effect"
  ],
  "title": "ToolSpec",
  "type": "object"
}
