# onf_create_variable

Declare a workspace variable with its initial JSON value and expectedRevision:0. Primitive type or exact custom type/version is immutable. Name is unique and case-sensitive in its workspace; returned revisions are globally monotonic and nee

Canonical URL: https://opennodeflow.dev/wiki/tool-onf-create-variable/
JSON reference: https://opennodeflow.dev/wiki/tool-onf-create-variable/index.json
Source snapshot: 2026-10-23

Declare a workspace variable with its initial JSON value and expectedRevision:0. Primitive type or exact custom type/version is immutable. Name is unique and case-sensitive in its workspace; returned revisions are globally monotonic and need not begin at 1.

[Agent workflow authoring](/wiki/mcp-workflow-authoring/) · [All MCP tools](/wiki/mcp-tools/)

## Inputs

| Field | Required | Contract |
| --- | --- | --- |
| `scope` | Yes | object |
| `name` | Yes | string |
| `type` | Yes | string |
| `typeVersion` | No | integer |
| `value` | Yes | Structured value |
| `expectedRevision` | Yes | number |

## Exact input schema


```json
{
  "type": "object",
  "properties": {
    "scope": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "workspace"
        },
        "workspaceId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.-]{1,120}$"
        }
      },
      "required": [
        "kind",
        "workspaceId"
      ],
      "additionalProperties": false
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "type": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_.-]{1,120}$"
    },
    "typeVersion": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "value": {},
    "expectedRevision": {
      "type": "number",
      "const": 0
    }
  },
  "required": [
    "scope",
    "name",
    "type",
    "value",
    "expectedRevision"
  ]
}
```


## MCP annotations

- `readOnlyHint`: `false`
- `destructiveHint`: `false`
- `idempotentHint`: `false`
- `openWorldHint`: `false`

Annotations describe tool behavior; they are not an authorization boundary.

## Calling this tool

Use the exact registered name `onf_create_variable` through a compatible MCP client. Start with discovery and read the current object before a change. Pass the documented revision or version guards where required. A JSON Schema default is not a substitute for reading the tool contract.

See [connection setup](/wiki/mcp-connect/) and [agent safety](/wiki/agent-safety/) for transport, permissions and uncertain-action recovery.

---

## Documentation provenance

- `server/variable-tools.ts`

This page describes maintained source, not a live inventory or an authorization to perform actions.
