Skip to main content
Glama

sheets.spreadsheets.values.batchGetByDataFilter

Retrieve spreadsheet values across multiple ranges by matching specified data filters; provide the spreadsheet ID and one or more filters.

Instructions

Returns one or more ranges of values that match the specified data filters. For more information, see Read, write, and search metadata. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges that match any of the data filters in the request will be returned [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 BatchGetValuesByDataFilterRequest object accepting dataFilters, dateTimeRenderOption, majorDimension, valueRenderOption; pass it via params or whole via body_file Siblings over the same resource: append, batchClear, batchClearByDataFilter, batchGet, batchUpdate, batchUpdateByDataFilter, 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 BatchGetValuesByDataFilterRequest object.
request_bodyNoRequest body of type BatchGetValuesByDataFilterRequest: pass it via `params` (merged into the built body) or whole via `body_file`.
spreadsheetIdYes[URL path segment] The ID of the spreadsheet to retrieve data from.

Output Schema

NameRequiredDescriptionDefault
valueRangesNo
spreadsheetIdNo

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 BatchGetValuesByDataFilterRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type BatchGetValuesByDataFilterRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "dataFilters": {
      +      "items": {
      +        "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": {
      +                "properties": {
      +                  "dimensionRange": {
      +                    "type": "object"
      +                  },
      +                  "locationType": {
      +                    "enum": [
      +                      "DEVELOPER_METADATA_LOCATION_TYPE_UNSPECIFIED",
      +                      "ROW",
      +                      "COLUMN",
      +                      "SHEET",
      +                      "SPREADSHEET"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "sheetId": {
      +                    "type": "integer"
      +                  },
      +                  "spreadsheet": {
      +                    "type": "boolean"
      +                  }
      +                },
      +                "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"
      +      },
      +      "type": "array"
      +    },
      +    "dateTimeRenderOption": {
      +      "enum": [
      +        "SERIAL_NUMBER",
      +        "FORMATTED_STRING"
      +      ],
      +      "type": "string"
      +    },
      +    "majorDimension": {
      +      "enum": [
      +        "DIMENSION_UNSPECIFIED",
      +        "ROWS",
      +        "COLUMNS"
      +      ],
      +      "type": "string"
      +    },
      +    "valueRenderOption": {
      +      "enum": [
      +        "FORMATTED_VALUE",
      +        "UNFORMATTED_VALUE",
      +        "FORMULA"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / spreadsheetId / description
      Previous value: -"The ID of the spreadsheet to retrieve data from."New value: +"[URL path segment] The ID of the spreadsheet to retrieve data from."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "spreadsheetId": {
      +      "type": "string"
      +    },
      +    "valueRanges": {
      +      "items": {
      +        "properties": {
      +          "dataFilters": {
      +            "items": {
      +              "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"
      +            },
      +            "type": "array"
      +          },
      +          "valueRange": {
      +            "properties": {
      +              "majorDimension": {
      +                "enum": [
      +                  "DIMENSION_UNSPECIFIED",
      +                  "ROWS",
      +                  "COLUMNS"
      +                ],
      +                "type": "string"
      +              },
      +              "range": {
      +                "type": "string"
      +              },
      +              "values": {
      +                "items": {
      +                  "items": {
      +                    "type": "any"
      +                  },
      +                  "type": "array"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "type": "object"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description must carry the full behavioral burden. It usefully discloses the JSON response and request-body format, but its claim that '[HTTP POST] — creates or triggers a change' mischaracterizes a values read operation as a mutation, which could lead an agent to avoid or misuse the tool.

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?

The description front-loads the core purpose and requirements, but it includes a long sibling list without distinctions and a misleading HTTP POST note. Some content earns its place, but the listing and mischaracterization reduce efficiency.

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

Completeness3/5

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

For a complex nested-body read tool, the description covers the required spreadsheet ID, data filters, request body shape, and response format. However, it lacks clear alternative-selection guidance and contains a significant behavioral misstatement about the operation creating or triggering changes.

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 schema already documents all parameters thoroughly. The description adds only marginal value by naming body fields and explaining `params`/`body_file` usage, which is close to the baseline for high-coverage schemas.

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?

The description states a specific verb and resource: it returns ranges of values matching data filters. However, it does not clearly differentiate this tool from batchGet or getByDataFilter beyond listing sibling names without selection criteria.

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?

The description says the caller must provide a spreadsheet ID and one or more DataFilters, which is a requirement rather than usage guidance. It names sibling tools such as batchGet and get but gives no explicit when-to-use-this-vs-alternative 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