{
  "name": "edit_dashboard_source",
  "description": "Apply atomic exact-text replacements to one canonical dashboard YAML revision. Each oldText must match exactly once; invalid, ambiguous, overlapping, or stale edits leave the draft unchanged.",
  "authzMode": "privilege",
  "privilege": "RESOURCE_EDIT",
  "effect": "write",
  "operationId": "manual",
  "defaults": {},
  "tags": [
    "dashboard",
    "authoring",
    "source"
  ],
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
  },
  "inputSchema": {
    "additionalProperties": false,
    "properties": {
      "dashboardId": {
        "minLength": 1,
        "type": "string"
      },
      "draftId": {
        "minLength": 1,
        "type": "string"
      },
      "edits": {
        "items": {
          "additionalProperties": false,
          "properties": {
            "newText": {
              "type": "string"
            },
            "oldText": {
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "newText",
            "oldText"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "expectedRevision": {
        "additionalProperties": false,
        "properties": {
          "contentHash": {
            "type": "string"
          },
          "number": {
            "type": "integer"
          },
          "revisionId": {
            "type": "string"
          }
        },
        "required": [
          "contentHash",
          "number",
          "revisionId"
        ],
        "type": "object"
      }
    },
    "required": [
      "dashboardId",
      "draftId",
      "edits",
      "expectedRevision"
    ],
    "type": "object"
  },
  "outputSchema": {
    "additionalProperties": false,
    "properties": {
      "changedBlocks": {
        "type": "integer"
      },
      "diff": {
        "type": "string"
      },
      "lifecycle": {
        "additionalProperties": {},
        "type": "object"
      },
      "revision": {
        "additionalProperties": {},
        "type": "object"
      },
      "yaml": {
        "type": "string"
      }
    },
    "required": [
      "changedBlocks",
      "diff",
      "lifecycle",
      "revision",
      "yaml"
    ],
    "type": "object"
  }
}
