Skip to main content
Glama

sheets_get_formatting_compact

Read-onlyIdempotent

Fetch cell formatting for a Google Sheets range as compact A1Range-to-format pairs, collapsing adjacent identical cells to cut data by over 90% compared to per-cell output.

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.
Behavior5/5

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

Beyond the readOnly and idempotent annotations, the description discloses the output compression behavior (collapsing adjacent identical cells, 90%+ size reduction) and the supported format fields. This adds meaningful behavioral context not present in annotations.

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 concise and front-loaded: first sentence states purpose and output, second explains run-length encoding, third gives usage guidance, and fourth lists supported fields. Every sentence earns its place 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?

Despite lacking an output schema, the description adequately explains the return format (A1Range→format pairs with run-length encoding) and supported fields. It doesn't detail the exact JSON structure, but for a read-only formatting retrieval tool, this is sufficient. Slightly more detail on the pair structure could improve completeness, but it's already strong.

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 covers 100% of parameters, so baseline is 3. The description adds value by explicitly listing the allowed values for the 'fields' parameter (e.g., backgroundColor, textFormat), which supplements the schema's generic description. It also clarifies the compact output relates to parameter choices.

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, using run-length encoding. It distinguishes from sibling tools by recommending it over sheets_get_full_sheet_snapshot for formatting-only needs and lists supported fields.

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

Usage Guidelines5/5

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

Explicit guidance is given: 'Use instead of sheets_get_full_sheet_snapshot when you only need formatting data.' This clearly indicates a use case and names an alternative, helping the agent select the right tool among many siblings.

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