{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/tool-call.schema.json",
  "title": "Tool call result",
  "description": "What POST /v1/tools/{name}/call returns (`toolkit-tools.mjs call`): the tool's result as text, JSON (as text) and images (base64, image types only). Every text is redacted.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "tool", "risk", "isError", "content"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "tool": {
      "type": "string"
    },
    "risk": {
      "enum": ["read", "low", "high"]
    },
    "isError": {
      "type": "boolean"
    },
    "content": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["kind"],
        "properties": {
          "kind": {
            "enum": ["text", "json", "image"]
          },
          "text": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        }
      }
    }
  }
}
