{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/hegemonart/get-design-done/main/scripts/mcp-servers/gdd-state/schemas/frontmatter_update.schema.json",
  "title": "GddStateFrontmatterUpdate",
  "description": "MCP tool gdd_state__frontmatter_update — patch one or more frontmatter fields. Rejects pipeline_state_version and stage (must use transition_stage). Emits state.mutation.",
  "type": "object",
  "additionalProperties": false,
  "required": ["input", "output"],
  "properties": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": ["patch"],
      "properties": {
        "patch": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "oneOf": [
              { "type": "string", "maxLength": 8192 },
              { "type": "number" },
              { "type": "boolean" }
            ]
          },
          "description": "Key/value pairs to merge into frontmatter. Disallowed keys: pipeline_state_version, stage."
        }
      }
    },
    "output": {
      "type": "object",
      "additionalProperties": false,
      "required": ["success"],
      "properties": {
        "success": { "type": "boolean" },
        "data": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "frontmatter": {
              "type": "object",
              "description": "The full frontmatter map after patch."
            },
            "keys": {
              "type": "array",
              "items": { "type": "string" }
            }
          }
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "required": ["code", "message", "kind"],
          "properties": {
            "code": { "type": "string" },
            "message": { "type": "string" },
            "kind": { "type": "string", "enum": ["validation", "state_conflict", "operation_failed", "unknown"] }
          }
        }
      }
    }
  }
}
