Skip to main content
Glama

sheets.spreadsheets.values.batchUpdateByDataFilter

Writes values to multiple spreadsheet ranges selected by data filters, enabling targeted batch updates in one request.

Instructions

Sets values in one or more ranges of a spreadsheet. For more information, see Read, write, and search metadata. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON BatchUpdateValuesByDataFilterRequest object accepting data, includeValuesInResponse, responseDateTimeRenderOption, responseValueRenderOption, valueInputOption; pass it via params or whole via body_file Siblings over the same resource: append, batchClear, batchClearByDataFilter, batchGet, batchGetByDataFilter, batchUpdate, clear, get, update.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
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 BatchUpdateValuesByDataFilterRequest object.
request_bodyNoRequest body of type BatchUpdateValuesByDataFilterRequest: 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.

Output Schema

NameRequiredDescriptionDefault
responsesNo
spreadsheetIdNo
totalUpdatedRowsNo
totalUpdatedCellsNo
totalUpdatedSheetsNo
totalUpdatedColumnsNo

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 BatchUpdateValuesByDataFilterRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type BatchUpdateValuesByDataFilterRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "data": {
      +      "items": {
      +        "properties": {
      +          "dataFilter": {
      +            "properties": {
      +              "a1Range": {
      +                "type": "string"
      +              },
      +              "developerMetadataLookup": {
      +                "properties": {
      +                  "locationMatchingStrategy": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_LOCATION_MATCHING_STRATEGY_UNSPECIFIED",
      +                      "EXACT_LOCATION",
      +                      "INTERSECTING_LOCATION"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "locationType": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_LOCATION_TYPE_UNSPECIFIED",
      +                      "ROW",
      +                      "COLUMN",
      +                      "SHEET",
      +                      "SPREADSHEET"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "metadataId": {
      +                    "type": "integer"
      +                  },
      +                  "metadataKey": {
      +                    "type": "string"
      +                  },
      +                  "metadataLocation": {
      +                    "type": "object"
      +                  },
      +                  "metadataValue": {
      +                    "type": "string"
      +                  },
      +                  "visibility": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_VISIBILITY_UNSPECIFIED",
      +                      "DOCUMENT",
      +                      "PROJECT"
      +                    ],
      +                    "type": "string"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "gridRange": {
      +                "properties": {
      +                  "endColumnIndex": {
      +                    "type": "integer"
      +                  },
      +                  "endRowIndex": {
      +                    "type": "integer"
      +                  },
      +                  "sheetId": {
      +                    "type": "integer"
      +                  },
      +                  "startColumnIndex": {
      +                    "type": "integer"
      +                  },
      +                  "startRowIndex": {
      +                    "type": "integer"
      +                  }
      +                },
      +                "type": "object"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "majorDimension": {
      +            "enum": [
      +              "DIMENSION_UNSPECIFIED",
      +              "ROWS",
      +              "COLUMNS"
      +            ],
      +            "type": "string"
      +          },
      +          "values": {
      +            "items": {
      +              "items": {
      +                "type": "any"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "includeValuesInResponse": {
      +      "type": "boolean"
      +    },
      +    "responseDateTimeRenderOption": {
      +      "enum": [
      +        "SERIAL_NUMBER",
      +        "FORMATTED_STRING"
      +      ],
      +      "type": "string"
      +    },
      +    "responseValueRenderOption": {
      +      "enum": [
      +        "FORMATTED_VALUE",
      +        "UNFORMATTED_VALUE",
      +        "FORMULA"
      +      ],
      +      "type": "string"
      +    },
      +    "valueInputOption": {
      +      "enum": [
      +        "INPUT_VALUE_OPTION_UNSPECIFIED",
      +        "RAW",
      +        "USER_ENTERED"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • 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."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "responses": {
      +      "items": {
      +        "properties": {
      +          "dataFilter": {
      +            "properties": {
      +              "a1Range": {
      +                "type": "string"
      +              },
      +              "developerMetadataLookup": {
      +                "properties": {
      +                  "locationMatchingStrategy": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_LOCATION_MATCHING_STRATEGY_UNSPECIFIED",
      +                      "EXACT_LOCATION",
      +                      "INTERSECTING_LOCATION"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "locationType": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_LOCATION_TYPE_UNSPECIFIED",
      +                      "ROW",
      +                      "COLUMN",
      +                      "SHEET",
      +                      "SPREADSHEET"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "metadataId": {
      +                    "type": "integer"
      +                  },
      +                  "metadataKey": {
      +                    "type": "string"
      +                  },
      +                  "metadataLocation": {
      +                    "type": "object"
      +                  },
      +                  "metadataValue": {
      +                    "type": "string"
      +                  },
      +                  "visibility": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_VISIBILITY_UNSPECIFIED",
      +                      "DOCUMENT",
      +                      "PROJECT"
      +                    ],
      +                    "type": "string"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "gridRange": {
      +                "properties": {
      +                  "endColumnIndex": {
      +                    "type": "integer"
      +                  },
      +                  "endRowIndex": {
      +                    "type": "integer"
      +                  },
      +                  "sheetId": {
      +                    "type": "integer"
      +                  },
      +                  "startColumnIndex": {
      +                    "type": "integer"
      +                  },
      +                  "startRowIndex": {
      +                    "type": "integer"
      +                  }
      +                },
      +                "type": "object"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "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"
      +      },
      +      "type": "array"
      +    },
      +    "spreadsheetId": {
      +      "type": "string"
      +    },
      +    "totalUpdatedCells": {
      +      "type": "integer"
      +    },
      +    "totalUpdatedColumns": {
      +      "type": "integer"
      +    },
      +    "totalUpdatedRows": {
      +      "type": "integer"
      +    },
      +    "totalUpdatedSheets": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.6/5.0
Behavior4/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 well: it declares the tool mutates ('creates or triggers a change'), is refused under --readonly safety profiles, and returns the API response resource as JSON. It does not state whether values overwrite existing cells at matched ranges or how conflicts across overlapping filters behave, which keeps it short of a 5.

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

Conciseness3/5

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

It is front-loaded with the core action and requirement, but mid-sentence insertions ('[HTTP POST] — creates or triggers a change') and the trailing sibling list make it a dense run-on. The sibling list is informative but not differentiated, so it costs tokens without aiding selection.

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 a nested-body mutation tool, the description covers the calling contract (required inputs, body routing via params or body_file, readonly refusal) and an output schema exists so return details need not be spelled out. Overwrite semantics for matched ranges remain unspecified, but nothing blocking is missing.

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 description coverage is 100%, so the baseline is 3. The description enumerates the body fields (data, includeValuesInResponse, responseDateTimeRenderOption, responseValueRenderOption, valueInputOption) and the params/body_file routing, but that mostly repeats what the schema already documents.

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 and resource: 'Sets values in one or more ranges of a spreadsheet,' and names the required inputs (spreadsheet ID, valueInputOption, DataFilterValueRanges). It lists sibling tools but does not explain how this differs from batchUpdate or update, so the ByDataFilter distinction is left to be inferred from the name.

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

Usage Guidelines3/5

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

It gives prerequisites (spreadsheet ID, valueInputOption, one or more DataFilterValueRanges) and mentions the --readonly profile refusal, which is real usage guidance. However, listing the siblings 'append, batchClear, ... update' without saying when to pick this one over batchUpdate is a name dump, not selection guidance.

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