{
  "schemaVersion": 1,
  "snapshotDate": "2026-10-23",
  "slug": "tool-onf-operate-variable",
  "title": "onf_operate_variable",
  "section": "MCP tool reference",
  "description": "Atomically increment a number, append array items, compareAndSet an exact JSON value, or updatePath through existing JSON containers. Requires current expectedRevision; validates the complete pinned type and commits once. No automatic retry",
  "kind": "mcp",
  "url": "/wiki/tool-onf-operate-variable/",
  "markdown": "/wiki/tool-onf-operate-variable/index.md",
  "json": "/wiki/tool-onf-operate-variable/index.json",
  "headings": [
    {
      "id": "inputs",
      "title": "Inputs",
      "depth": 2
    },
    {
      "id": "exact-input-schema",
      "title": "Exact input schema",
      "depth": 2
    },
    {
      "id": "mcp-annotations",
      "title": "MCP annotations",
      "depth": 2
    },
    {
      "id": "calling-this-tool",
      "title": "Calling this tool",
      "depth": 2
    }
  ],
  "sources": [
    "server/variable-tools.ts"
  ],
  "contract": {
    "name": "onf_operate_variable",
    "description": "Atomically increment a number, append array items, compareAndSet an exact JSON value, or updatePath through existing JSON containers. Requires current expectedRevision; validates the complete pinned type and commits once. No automatic retry after an uncertain response. Known redacted content cannot be written back.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "enum": [
            "increment",
            "append",
            "compareAndSet",
            "updatePath"
          ]
        },
        "expectedRevision": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "amount": {
          "type": "number"
        },
        "items": {
          "maxItems": 10000,
          "type": "array",
          "items": {}
        },
        "expectedValue": {},
        "value": {},
        "path": {
          "minItems": 1,
          "maxItems": 32,
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9999
              }
            ]
          }
        },
        "variableId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.-]{1,120}$"
        }
      },
      "required": [
        "operation",
        "expectedRevision",
        "variableId"
      ]
    },
    "annotations": {
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": false,
      "openWorldHint": false
    },
    "source": {
      "file": "server/variable-tools.ts",
      "line": 107
    }
  }
}
