Skip to main content
Glama

Sort Range

sort_range
Destructive

Sort a selectable Excel range by any column, choosing ascending order and whether the first row is a header, to reorder data directly in the active workbook.

Instructions

Sort a range by one column.

Args: workbook: Workbook name or path (None = active workbook). sheet: Worksheet name (None = active sheet). range_address: The range to sort, e.g. "A1:C10". key_column: 1-based column offset within range_address to sort by (1 = the range's leftmost column). ascending: Sort direction. has_header: Whether the range's first row is a header (excluded from sorting, kept in place).

Returns: JSON confirmation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheetNo
workbookNo
ascendingNo
has_headerNo
key_columnNo
range_addressNoA1
Behavior4/5

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

The destructiveHint annotation already signals that sorting mutates state, and the description adds useful behavioral context: header rows are excluded from sorting and kept in place, key_column uses a 1-based offset, and workbook/sheet default to active objects. It does not explicitly state that the range is reordered in place, but the annotation covers the core safety signal.

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 compact and well-structured: a one-sentence purpose, a scannable argument list, and a return line. Every sentence adds necessary information with no filler.

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?

Given the absence of an output schema, the description appropriately states that the return is a JSON confirmation, and it documents all parameters. It could be slightly more explicit about in-place mutation and that only one key column is supported, but the annotation and the word 'sort' make these largely inferable.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden of documenting parameters. It explains all six parameters clearly, including defaults, an example range address, the 1-based key column offset, and header behavior. This fully compensates for the empty schema descriptions.

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 opens with 'Sort a range by one column' — a specific verb, resource, and scope. It is easily distinguishable from sibling range tools like get_range_values, set_range_values, and format_range.

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?

The description implies when to use the tool through its purpose and parameter documentation, but it never explicitly states when to prefer sort_range over alternatives or mentions limitations such as supporting only a single sort key. No exclusion or alternative guidance is provided.

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/trustypangolin/excel-mcp-live'

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