{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/goosybear-ai/json-schema/goosybear-ai-tool-refusal-schema.json",
  "title": "ToolRefusal",
  "description": "A call that was admitted and dispatched, and did not succeed.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/goosybear-ai-openapi.yml#/components/schemas/ToolRefusal",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "const": false
    },
    "code": {
      "type": "string",
      "description": "The typed reason — e.g. `workspace_ambiguous`, `invalid_arguments`, or the tool's own failure code."
    },
    "message": {
      "type": "string",
      "description": "A sentence a person can act on."
    },
    "workspaces": {
      "description": "On a workspace refusal: the slugs this key may pass as `workspace`.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "issues": {
      "description": "On `invalid_arguments`: which fields failed, and why.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "path": {
      "description": "On an authoring refusal: where in your call's input it points, e.g. `steps.<key>.params.<field>`.",
      "type": "string"
    },
    "fix": {
      "description": "On an authoring refusal: the change to your call that would pass.",
      "type": "string"
    },
    "instruction": {
      "description": "On an authoring refusal: what to do next with it.",
      "type": "string"
    }
  },
  "required": [
    "ok",
    "code",
    "message"
  ],
  "additionalProperties": false
}