Skip to main content
Glama

sort_range

Sorts a worksheet range by one or more columns using zero-based offsets, with optional header preservation and ascending or descending order.

Instructions

Sort a range by one or more columns. Fields are given as zero-based column offsets within the range.

Input Schema

NameRequiredDescriptionDefault
rangeYesA1 range address to sort, e.g. "A2:D100" (include or exclude headers as needed).
fieldsYesSort fields, applied in order.
sheetNameNoWorksheet name. Defaults to the active worksheet.
hasHeadersNoTrue if the first row is a header row that should not be sorted. Default false.
workbookIdNoTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It implies a mutation but does not state that the range is sorted in place, whether existing formatting is affected, what permissions are required, or what the tool returns. This is a significant gap for a write operation with zero annotation coverage.

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 two short sentences with no wasted wording, and the core operation is front-loaded. It is appropriately sized for the tool's basic purpose.

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?

The schema richly documents all parameters, which supports correct invocation, and the description identifies the operation. However, with no annotations or output schema, the description should say more about mutation behavior and return semantics. It is minimally adequate but leaves meaningful behavioral gaps.

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 all five parameters are already documented in the schema. The description reiterates that fields are zero-based column offsets, matching the schema's own column description, but adds no additional parameter semantics beyond what structured data provides. Baseline 3 is appropriate.

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 clearly states a specific verb and resource: sort a range by one or more columns. It also clarifies the field addressing model, so an agent understands the core operation without opening the schema. It does not explicitly differentiate itself from other range-manipulation siblings, but the operation is distinct enough.

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 what the tool does but gives no guidance on when to use it versus alternatives such as format_range, read_range, or write_range. There are no prerequisites, exclusions, or context cues for selecting this tool.

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