Skip to main content
Glama

sheets.spreadsheets.values.update

Writes values to a specified range in a Google Sheet using spreadsheet ID, range, and input option; returns the API response JSON.

Instructions

Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption [HTTP PUT] — updates the resource; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON ValueRange object accepting majorDimension, range, values; pass it via params or whole via body_file Siblings over the same resource: append, batchClear, batchClearByDataFilter, batchGet, batchGetByDataFilter, batchUpdate, batchUpdateByDataFilter, clear, get.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
rangeYes[URL path segment] The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON ValueRange object.
request_bodyNoRequest body of type ValueRange: pass it via `params` (merged into the built body) or whole via `body_file`.
spreadsheetIdYes[URL path segment] The ID of the spreadsheet to update.
valueInputOptionNo[query parameter] How the input data should be interpreted. Values: `INPUT_VALUE_OPTION_UNSPECIFIED` = Default input value. This value must not be used.; `RAW` = The values the user has entered will not be parsed and will be stored as-is.; `USER_ENTERED` = The values will be parsed as if the user typed them into the UI. Numbers will stay as numbers, but strings may be converted to numbers, dates, etc. following the same rules that are applied when entering text into a cell via the Google Sheets UI..
includeValuesInResponseNo[query parameter] Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the rang
responseValueRenderOptionNo[query parameter] Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE. Values: `FORMATTED_VALUE` = Values will be calculated & formatted in the response according to the cell's formatting. Formatting is based on the spreadsheet's locale, not the requesting user's locale. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return `"$1.23"`.; `UNFORMATTED_VALUE` = Values will be calculated, but not formatted in the reply. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return the number `1.23`.; `FORMULA` = Values will not be calculated. The reply will include the formulas. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then A2 would return `"=A1"`. Sheets treats date and time values as decimal values. This lets you perform arithmetic on them in formulas. For more information on interpreting date and time values, see [About date & time values](https://developers.google.com/workspace/sheets/api/guides/formats#about_date_time_values)..
responseDateTimeRenderOptionNo[query parameter] Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default d Values: `SERIAL_NUMBER` = Instructs date, time, datetime, and duration fields to be output as doubles in "serial number" format, as popularized by Lotus 1-2-3. The whole number portion of the value (left of the decimal) counts the days since December 30th 1899. The fractional portion (right of the decimal) counts the time as a fraction of the day. For example, January 1st 1900 at noon would be 2.5, 2 because it's 2 days after December 30th 1899, and .5 because noon is half a day. February 1st 1900 at 3pm would be 33.625. This correctly treats the year 1900 as not a leap year.; `FORMATTED_STRING` = Instructs date, time, datetime, and duration fields to be output as strings in their given number format (which depends on the spreadsheet locale)..

Output Schema

NameRequiredDescriptionDefault
updatedDataNo
updatedRowsNo
updatedCellsNo
updatedRangeNo
spreadsheetIdNo
updatedColumnsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON ValueRange object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type ValueRange: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "majorDimension": {
      +      "enum": [
      +        "DIMENSION_UNSPECIFIED",
      +        "ROWS",
      +        "COLUMNS"
      +      ],
      +      "type": "string"
      +    },
      +    "range": {
      +      "type": "string"
      +    },
      +    "values": {
      +      "items": {
      +        "items": {
      +          "type": "any"
      +        },
      +        "type": "array"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed7 schema fields changed
    • changedInput schema / properties / includeValuesInResponse / description
      Previous value: -"Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the rang"New value: +"[query parameter] Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the rang"
    • changedInput schema / properties / range / description
      Previous value: -"The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update."New value: +"[URL path segment] The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update."
    • changedInput schema / properties / responseDateTimeRenderOption / description
      Previous value: -"Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default d"New value: +"[query parameter] Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default d Values: `SERIAL_NUMBER` = Instructs date, time, datetime, and duration fields to be output as doubles in \"serial number\" format, as popularized by Lotus 1-2-3. The whole number portion of the value (left of the decimal) counts the days since December 30th 1899. The fractional portion (right of the decimal) counts the time as a fraction of the day. For example, January 1st 1900 at noon would be 2.5, 2 because it's 2 days after December 30th 1899, and .5 because noon is half a day. February 1st 1900 at 3pm would be 33.625. This correctly treats the year 1900 as not a leap year.; `FORMATTED_STRING` = Instructs date, time, datetime, and duration fields to be output as strings in their given number format (which depends on the spreadsheet locale).."
    • changedInput schema / properties / responseValueRenderOption / description
      Previous value: -"Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE."New value: +"[query parameter] Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE. Values: `FORMATTED_VALUE` = Values will be calculated & formatted in the response according to the cell's formatting. Formatting is based on the spreadsheet's locale, not the requesting user's locale. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return `\"$1.23\"`.; `UNFORMATTED_VALUE` = Values will be calculated, but not formatted in the reply. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return the number `1.23`.; `FORMULA` = Values will not be calculated. The reply will include the formulas. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then A2 would return `\"=A1\"`. Sheets treats date and time values as decimal values. This lets you perform arithmetic on them in formulas. For more information on interpreting date and time values, see [About date & time values](https://developers.google.com/workspace/sheets/api/guides/formats#about_date_time_values).."
    • changedInput schema / properties / spreadsheetId / description
      Previous value: -"The ID of the spreadsheet to update."New value: +"[URL path segment] The ID of the spreadsheet to update."
    • changedInput schema / properties / valueInputOption / description
      Previous value: -"How the input data should be interpreted."New value: +"[query parameter] How the input data should be interpreted. Values: `INPUT_VALUE_OPTION_UNSPECIFIED` = Default input value. This value must not be used.; `RAW` = The values the user has entered will not be parsed and will be stored as-is.; `USER_ENTERED` = The values will be parsed as if the user typed them into the UI. Numbers will stay as numbers, but strings may be converted to numbers, dates, etc. following the same rules that are applied when entering text into a cell via the Google Sheets UI.."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "spreadsheetId": {
      +      "type": "string"
      +    },
      +    "updatedCells": {
      +      "type": "integer"
      +    },
      +    "updatedColumns": {
      +      "type": "integer"
      +    },
      +    "updatedData": {
      +      "properties": {
      +        "majorDimension": {
      +          "enum": [
      +            "DIMENSION_UNSPECIFIED",
      +            "ROWS",
      +            "COLUMNS"
      +          ],
      +          "type": "string"
      +        },
      +        "range": {
      +          "type": "string"
      +        },
      +        "values": {
      +          "items": {
      +            "items": {
      +              "type": "any"
      +            },
      +            "type": "array"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "updatedRange": {
      +      "type": "string"
      +    },
      +    "updatedRows": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does add real context: HTTP PUT semantics and the fact that it is refused under --readonly safety profiles, which is meaningful safety disclosure for a write tool. However, it never warns that existing cell values across the target range are replaced/cleared, nor mentions quota or scopes, so the destructive characteristic is understated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence and the body/safety notes follow in a logical order. The nine-item sibling list is a dense, low-value tail that consumes attention without adding routing information, but the rest is compact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation tool with a rich schema and an output schema, the description covers what the operation is, how the body is supplied, and the read-only refusal. The query parameters are left to the schema and return values are covered by the output schema, so the remaining gap is mainly the missing overwrite warning.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all 11 parameters including the ValueRange body and valueInputOption. The description restates the required trio (spreadsheetId, range, valueInputOption) and the body shortcut (params vs body_file) but adds no semantics the schema does not already contain.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: 'Sets values in a range of a spreadsheet.' The tool's function is unmistakable. It names sibling tools over the same resource, but only as a bare list, so it doesn't actually differentiate what each one does relative to this one, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Beyond listing sibling names (append, batchUpdate, clear, get, etc.), there is no guidance on when to reach for update versus append or batchUpdate, and no prerequisites beyond the required parameters. The sibling enumeration raises the possibility of alternatives but gives no condition for choosing among them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools