Skip to main content
Glama

sort_range

Sort rows in an Excel range by a specified column. Keep headers in place; use stable sorting for multi-key sorts.

Instructions

Sort the rows of a range by one column's values.

by_column is the sheet column letter (e.g. 'B') and must fall inside the range. Set has_header=true if the range's first row is a header to keep in place. Numbers and dates sort before text; blank cells always sort last. Only values move — formatting stays put, and formulas move as text (their relative references are NOT adjusted). For multi-key sorts, call once per key from least to most significant column (the sort is stable).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYes
by_columnYes
descendingNo
has_headerNo
session_idYes
Behavior5/5

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

Discloses important behaviors: sorting order (numbers/dates before text, blanks last), that formatting stays put, formulas move as text without adjusting relative references, and stability for multi-key sorts. No annotations provided, so description fully covers transparency.

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?

Front-loaded with main action, then concise bullet-like details. Each sentence adds value, though slightly long for a description.

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 no output schema and 5 parameters, the description covers key behaviors and parameter usage. Explains important side effects (formatting, formulas). Lacks mention of return value, but sorting typically modifies sheet in place.

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?

Adds meaning to by_column (sheet column letter) and has_header (keep header). Does not explain range format or descending, but schema coverage was 0% so description compensates well. Could be slightly more explicit on range format.

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 sorts rows by one column's values, specifying verb, resource, and method. It distinguishes itself from sibling tools like remove_duplicates or apply_auto_filter.

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?

Provides explicit guidance on using by_column as a column letter, has_header to keep header, and multi-key sort procedure. Does not explicitly state when not to use, but sufficient for correct invocation.

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/ShubhamDbug/Excel-MCP'

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