Skip to main content
Glama

sheets_get_formatting_compact

Retrieve cell formatting for a Google Sheets range as compact A1Range→format pairs, collapsing adjacent cells with identical formatting into rectangular ranges to reduce output by over 90% compared to per-cell formatting.

Instructions

Returns cell formatting for a range as compact A1Range→format pairs. Adjacent cells with identical formatting are collapsed into rectangular ranges (run-length encoded). Reduces output by 90%+ compared to per-cell formatting for typical sheets. Use instead of sheets_get_full_sheet_snapshot when you only need formatting data. Supported fields: backgroundColor, backgroundColorStyle, textFormat, horizontalAlignment, verticalAlignment, wrapStrategy, textRotation, numberFormat, padding, borders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYesRange WITHOUT sheet prefix, e.g. "A1:Z85"
fieldsNoOptional list of format fields to include, e.g. ["backgroundColor", "textFormat", "borders"]. All supported fields returned if omitted.
sheetNameYesName of the sheet (tab)
spreadsheetIdYesThe ID of the spreadsheet (found in the URL after /d/)
useEffectiveFormatNoUse effectiveFormat (true, includes all inherited defaults) or userEnteredFormat (false, default — only explicit overrides). userEnteredFormat produces much smaller output.
Behavior4/5

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

Given no annotations, the description explains the run-length encoding output, 90%+ size reduction, and the difference between useEffectiveFormat and userEnteredFormat, though it does not mention error handling or performance characteristics.

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

Conciseness5/5

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

The description is a single paragraph but efficiently front-loads the action, then explains behavior, benefit, usage hint, and supported fields without redundancy.

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 retrieval tool with 5 parameters and no output schema, the description adequately explains output format and behavior. It lists supported fields and distinguishes format modes, but lacks error handling details.

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

Parameters4/5

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

Schema coverage is 100%, and the description adds context beyond the schema: clarifies range format, provides example for fields, and explains the trade-off in useEffectiveFormat with respect to output size.

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?

The description clearly states the tool returns cell formatting as compact A1Range→format pairs with run-length encoding, and distinguishes from sibling tool sheets_get_full_sheet_snapshot by specifying it is for formatting-only needs.

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

Usage Guidelines4/5

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

The description explicitly recommends using this tool instead of sheets_get_full_sheet_snapshot when only formatting is needed, but does not discuss when to use other formatting tools like sheets_batch_format_cells.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/freema/mcp-gsheets'

If you have feedback or need assistance with the MCP directory API, please join our Discord server