Skip to main content
Glama

sheets.spreadsheets.values.batchClear

Clears values from one or more spreadsheet ranges while preserving cell formatting and data validation. Specify the spreadsheet ID and ranges to remove data without deleting other cell properties.

Instructions

Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. Only values are cleared -- all other properties of the cell (such as formatting and data validation) are kept [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 BatchClearValuesRequest object accepting ranges; pass it via params or whole via body_file Siblings over the same resource: append, batchClearByDataFilter, batchGet, batchGetByDataFilter, 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 BatchClearValuesRequest object.
request_bodyNoRequest body of type BatchClearValuesRequest: 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
clearedRangesNo
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 BatchClearValuesRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type BatchClearValuesRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "ranges": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "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": {
      +    "clearedRanges": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "spreadsheetId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It does well on the mutation/scope side: values are destroyed but formatting and data validation are preserved, and it flags 'HTTP POST — creates or triggers a change; refused under --readonly safety profiles', which is genuinely useful safety context. It does not discuss irreversibility of the cleared data, permissions needed, or quota/rate limits.

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 key scope and preservation behavior are front-loaded in the first two sentences. The bracketed HTTP-POST/readonly note is useful, but the trailing sibling enumeration is a bare list that adds length without routing value.

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 mutation tool with no annotations, this covers what is destroyed, what is preserved, the readonly-profile refusal, and that an output schema exists (so return values need no explanation). Missing permissions/quota context keeps it short of a 5.

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 baseline is 3. The description repeats what the schema already documents ('pass it via params or whole via body_file') rather than adding new semantics, and the ranges-batch construction is already spelled out in the request_body schema.

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

Purpose5/5

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

States a specific verb (clears), a specific scope (one or more ranges of values) and resource (spreadsheet), and adds a precise effect clause: 'Only values are cleared -- all other properties of the cell (such as formatting and data validation) are kept.' That effect clause separates it from destructive siblings like spreadsheets.batchUpdate and clarifies it is not a full range delete.

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 ('The caller must specify the spreadsheet ID and one or more ranges') but never states when to prefer this over spreadsheets.values.clear (single range) or batchClearByDataFilter. The sibling list names alternatives but provides no conditions for choosing among them, leaving routing to inference.

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