{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "tiwater.office-mcp-input/docx_set_table_width",
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "minLength": 1,
      "x-tiwater-file-role": "read",
      "x-tiwater-document-revision-role": "current"
    },
    "changes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "table": {
            "type": "object",
            "properties": {
              "part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
              "path": { "type": "string", "pattern": "^\\/[A-Za-z_][A-Za-z0-9_.-]*:[A-Za-z_][A-Za-z0-9_.-]*\\[[1-9][0-9]*\\](?:\\/[A-Za-z_][A-Za-z0-9_.-]*:[A-Za-z_][A-Za-z0-9_.-]*\\[[1-9][0-9]*\\])*$" }
            },
            "required": ["part", "path"],
            "additionalProperties": false
          },
          "width": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": { "type": "string", "enum": ["dxa", "pct"] },
                  "value": { "type": "string", "pattern": "^[1-9][0-9]*$" }
                },
                "required": ["type", "value"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": { "type": "string", "enum": ["auto", "nil"] },
                  "value": { "type": "string", "const": "0" }
                },
                "required": ["type", "value"],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": ["table", "width"],
        "additionalProperties": false
      }
    },
    "output": {
      "type": "string",
      "minLength": 1,
      "description": "Output DOCX path; may equal input for an atomic in-place update.",
      "x-tiwater-file-role": "write"
    },
    "receiptOutput": {
      "type": "string",
      "minLength": 1,
      "x-tiwater-file-role": "write",
      "x-tiwater-file-effect": false
    }
  },
  "required": ["input", "changes", "output", "receiptOutput"],
  "additionalProperties": false
}
