{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cbsshekhawat18-lab.github.io/karni/assets/karni-mcp.schema.json",
  "title": "karni mcp: the app-builder tools' results",
  "description": "Experimental. What the MCP tools recipes, spec_validate, questions, answer, plan, build, modules return: $defs/<tool> for each. plan, questions, build and recipes return their command's --json output, whose schema is published beside this one. Generated by python -m karni_cli.agent_tools. Never edit it by hand.",
  "anyOf": [
    {
      "$ref": "#/$defs/recipes"
    },
    {
      "$ref": "#/$defs/spec_validate"
    },
    {
      "$ref": "#/$defs/questions"
    },
    {
      "$ref": "#/$defs/answer"
    },
    {
      "$ref": "#/$defs/plan"
    },
    {
      "$ref": "#/$defs/build"
    },
    {
      "$ref": "#/$defs/modules"
    }
  ],
  "$defs": {
    "_AnswerOut": {
      "additionalProperties": false,
      "description": "answer: the answer written into the spec (karni spec answer).",
      "properties": {
        "version": {
          "const": 1,
          "description": "The version of this result: 1.",
          "type": "integer"
        },
        "file": {
          "description": "The spec file, as given.",
          "type": "string"
        },
        "valid": {
          "description": "false when the spec has problems: nothing was written.",
          "type": "boolean"
        },
        "issues": {
          "description": "The spec's problems (karni spec validate's).",
          "items": {
            "$ref": "#/$defs/_IssueOut"
          },
          "type": "array"
        },
        "id": {
          "description": "The question answered.",
          "type": "string"
        },
        "keys": {
          "description": "The dotted keys of karni.yaml the answer set.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "open": {
          "description": "How many questions are open now.",
          "type": "integer"
        },
        "next": {
          "description": "What to do next.",
          "type": "string"
        }
      },
      "required": [
        "version",
        "file",
        "valid",
        "issues",
        "id",
        "keys",
        "open",
        "next"
      ],
      "type": "object"
    },
    "_AskOut": {
      "additionalProperties": false,
      "properties": {
        "question": {
          "type": "string"
        },
        "setting": {
          "type": "string"
        },
        "options": {
          "items": {},
          "type": "array"
        },
        "default": {},
        "multiple": {
          "type": "boolean"
        }
      },
      "required": [
        "question",
        "setting",
        "options",
        "multiple"
      ],
      "type": "object"
    },
    "_EntryOut": {
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string"
        },
        "why": {
          "type": "string"
        },
        "manual": {
          "type": "boolean"
        }
      },
      "required": [
        "path",
        "why",
        "manual"
      ],
      "type": "object"
    },
    "_ErrorBody": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The error code (karni explain <code>)."
        },
        "message": {
          "description": "What went wrong, and what to do.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "_ErrorOut": {
      "additionalProperties": false,
      "description": "A failure the command reports as an error. Nothing was written.",
      "properties": {
        "error": {
          "$ref": "#/$defs/_ErrorBody"
        }
      },
      "required": [
        "error"
      ],
      "type": "object"
    },
    "_IssueOut": {
      "additionalProperties": false,
      "description": "A problem in the spec, as karni spec validate --json reports it.",
      "properties": {
        "code": {
          "description": "The error code (karni explain <code>).",
          "type": "string"
        },
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "The 1-based line, when known."
        },
        "path": {
          "description": "The dotted path of the key.",
          "type": "string"
        },
        "message": {
          "description": "What is wrong.",
          "type": "string"
        },
        "fix": {
          "description": "How to fix it.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "line",
        "path",
        "message",
        "fix"
      ],
      "type": "object"
    },
    "_ModuleLineOut": {
      "additionalProperties": false,
      "description": "One module or feature in a line.",
      "properties": {
        "name": {
          "description": "modules(name) shows it in full.",
          "type": "string"
        },
        "kind": {
          "enum": [
            "module",
            "feature"
          ],
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "state": {
          "enum": [
            "added",
            "installed",
            "available",
            "built in"
          ],
          "type": "string"
        },
        "purpose": {
          "type": "string"
        },
        "use_when": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "name",
        "kind",
        "status",
        "state",
        "purpose",
        "use_when"
      ],
      "type": "object"
    },
    "_ModuleOut": {
      "additionalProperties": false,
      "description": "One module or feature in full, as karni modules show --json prints it.",
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "module",
            "feature"
          ],
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "purpose": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "use_when": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "requires": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "conflicts": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "services": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "docs": {
          "type": "string"
        },
        "provides": {
          "$ref": "#/$defs/_ProvidesOut"
        },
        "asks": {
          "items": {
            "$ref": "#/$defs/_AskOut"
          },
          "type": "array"
        },
        "state": {
          "enum": [
            "added",
            "installed",
            "available",
            "built in"
          ],
          "type": "string"
        },
        "distribution": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "A module's PyPI name."
        },
        "wiring": {
          "anyOf": [
            {
              "$ref": "#/$defs/_WiringOut"
            },
            {
              "type": "null"
            }
          ],
          "description": "What karni add writes, for a module."
        },
        "switch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The setting that turns a feature on."
        },
        "extra": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The karni extra a feature needs."
        },
        "in_spec": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "false: karni.yaml has no key for the feature."
        }
      },
      "required": [
        "name",
        "kind",
        "title",
        "purpose",
        "status",
        "use_when",
        "requires",
        "conflicts",
        "services",
        "docs",
        "provides",
        "asks",
        "state"
      ],
      "type": "object"
    },
    "_ModuleShownOut": {
      "additionalProperties": false,
      "description": "modules(name): one module or feature in full.",
      "properties": {
        "version": {
          "const": 1,
          "description": "The version of this result: 1.",
          "type": "integer"
        },
        "module": {
          "$ref": "#/$defs/_ModuleOut"
        },
        "problems": {
          "description": "Manifests that could not be read (C314).",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "version",
        "module",
        "problems"
      ],
      "type": "object"
    },
    "_ModulesOut": {
      "additionalProperties": false,
      "description": "modules(): every module and feature in a line.",
      "properties": {
        "version": {
          "const": 1,
          "description": "The version of this result: 1.",
          "type": "integer"
        },
        "modules": {
          "description": "Modules first, then features.",
          "items": {
            "$ref": "#/$defs/_ModuleLineOut"
          },
          "type": "array"
        },
        "problems": {
          "description": "Manifests that could not be read (C314).",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "version",
        "modules",
        "problems"
      ],
      "type": "object"
    },
    "_ProvidesOut": {
      "additionalProperties": false,
      "properties": {
        "models": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "endpoints": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "pages": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "settings": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "object"
        },
        "ui": {
          "type": "string"
        }
      },
      "required": [
        "models",
        "endpoints",
        "pages",
        "settings",
        "ui"
      ],
      "type": "object"
    },
    "_ValidateOut": {
      "additionalProperties": false,
      "description": "spec_validate: what karni spec validate --json prints.",
      "properties": {
        "file": {
          "description": "The spec file, as given.",
          "type": "string"
        },
        "valid": {
          "description": "true when the spec has no problem.",
          "type": "boolean"
        },
        "issues": {
          "description": "Every problem, with its code, line and fix.",
          "items": {
            "$ref": "#/$defs/_IssueOut"
          },
          "type": "array"
        }
      },
      "required": [
        "file",
        "valid",
        "issues"
      ],
      "type": "object"
    },
    "_WiringOut": {
      "additionalProperties": false,
      "properties": {
        "apps": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "settings": {
          "type": "string"
        },
        "middleware": {
          "items": {
            "$ref": "#/$defs/_EntryOut"
          },
          "type": "array"
        },
        "context_processors": {
          "items": {
            "$ref": "#/$defs/_EntryOut"
          },
          "type": "array"
        },
        "urls": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "extras": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        }
      },
      "required": [
        "apps",
        "settings",
        "middleware",
        "context_processors",
        "urls",
        "kind",
        "extras"
      ],
      "type": "object"
    },
    "answer": {
      "anyOf": [
        {
          "$ref": "#/$defs/_AnswerOut"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    },
    "build": {
      "anyOf": [
        {
          "$ref": "https://cbsshekhawat18-lab.github.io/karni/assets/karni-build.schema.json"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    },
    "modules": {
      "anyOf": [
        {
          "$ref": "#/$defs/_ModulesOut"
        },
        {
          "$ref": "#/$defs/_ModuleShownOut"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    },
    "plan": {
      "anyOf": [
        {
          "$ref": "https://cbsshekhawat18-lab.github.io/karni/assets/karni-plan.schema.json"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    },
    "questions": {
      "anyOf": [
        {
          "$ref": "https://cbsshekhawat18-lab.github.io/karni/assets/karni-questions.schema.json"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    },
    "recipes": {
      "anyOf": [
        {
          "$ref": "https://cbsshekhawat18-lab.github.io/karni/assets/karni-recipes.schema.json"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    },
    "spec_validate": {
      "anyOf": [
        {
          "$ref": "#/$defs/_ValidateOut"
        },
        {
          "$ref": "#/$defs/_ErrorOut"
        }
      ]
    }
  }
}
