TRUECALC
MCP

format:setValign

Sets the vertical text alignment of a range.

Parameters

NameTypeRequiredDescription
sheetstringyesThe sheet name.
range{ from: string; to: string }yesThe target range, e.g. {"from": "A1", "to": "B3"}. May legitimately arrive "backwards", from below/right of to, normalized before use.
value"top", "middle", "bottom" or nullnoThe vertical alignment to set, or null for Sheets' default, bottom.

Returns

Nothing beyond the standard MCP success envelope.

Schema

Request payload, as JSON Schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Payload",
  "type": "object",
  "properties": {
    "sheet": {
      "description": "The sheet name.",
      "type": "string"
    },
    "range": {
      "description": "The target range, e.g. `{\"from\": \"A1\", \"to\": \"B3\"}`. May legitimately arrive \"backwards\", `from` below/right of `to`, normalized before use.",
      "$ref": "#/$defs/CellRange"
    },
    "value": {
      "description": "The vertical alignment to set, or `null` for Sheets' default, bottom.",
      "anyOf": [
        {
          "$ref": "#/$defs/VAlign"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "sheet",
    "range"
  ],
  "$defs": {
    "CellRange": {
      "description": "An inclusive rectangle. `from`/`to` may be equal, a single cell.",
      "type": "object",
      "properties": {
        "from": {
          "description": "Top-left cell, e.g. `\"A1\"`.",
          "type": "string"
        },
        "to": {
          "description": "Bottom-right cell, e.g. `\"B3\"`.",
          "type": "string"
        }
      },
      "required": [
        "from",
        "to"
      ]
    },
    "VAlign": {
      "description": "Vertical text alignment within the cell box.",
      "oneOf": [
        {
          "description": "Top of the cell box.",
          "type": "string",
          "const": "top"
        },
        {
          "description": "Vertically centred.",
          "type": "string",
          "const": "middle"
        },
        {
          "description": "Bottom of the cell box, Sheets' default.",
          "type": "string",
          "const": "bottom"
        }
      ]
    }
  }
}

On this page