{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/tools.schema.json",
  "title": "Toolkit tools",
  "description": "What GET /v1/tools returns (`toolkit-tools.mjs list`): every tool the registered multi-agent MCP server serves, with its category (the name's prefix), risk from its own annotations (readOnlyHint read, destructiveHint high, else low) and its inputSchema, from which a client builds the form. Calls are denied by default; allowed says which tools can be called and reason why the others cannot.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "tools"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "title",
          "category",
          "description",
          "risk",
          "inputSchema",
          "allowed",
          "reason"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": ["string", "null"]
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "risk": {
            "enum": ["read", "low", "high"]
          },
          "inputSchema": {
            "type": "object"
          },
          "allowed": {
            "type": "boolean",
            "description": "Whether POST /v1/tools/{name}/call accepts this tool: only a readOnlyHint tool whose inputSchema takes no location (path, URL, file, directory, output, project, root) and that is not in the web or context family."
          },
          "reason": {
            "type": ["string", "null"]
          }
        }
      }
    },
    "version": {
      "type": ["string", "null"],
      "description": "The exact toolkit version the panel starts: the registration's own when it names one, else the version the install recorded from the release.",
      "x-sensitivity": "none"
    }
  }
}
