Skip to main content
Glama

排序区域

sort_range

Sorts a specified range in an Excel sheet by a column, modifying the file while leaving other content untouched. Optionally use header names for reliable sorting.

Instructions

对一个区域按某列排序(会修改文件)。区域外的内容不动。有表头时传 hasHeader: true 并用表头名指定列更稳妥。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderYes
rangeYes矩形区域,如 `A1:D20`
filePathYesExcel 文件的绝对路径,例如 `C:\Users\xx\报表.xlsx` 或 `/Users/xx/报表.xlsx`。支持 .xlsx / .xls / .csv
hasHeaderNo
keyColumnYes
sheetNameYes
Behavior3/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. It does disclose that the operation '会修改文件' (will modify the file) and that content outside the range is untouched ('区域外的内容不动'). This is meaningful behavioral disclosure for a mutation, but it doesn't clarify whether sorting is reversible, what happens to formulas/formatting within the range, or the default ordering direction beyond the enum. Decent but not rich context.

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?

Two sentences, entirely functional, zero filler. Slightly longer than the TDQS high example due to two distinct clauses but each earns its place. Front-loaded with the core purpose then adds behavioral and usage notes efficiently. Very compact for the guidance it delivers.

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?

No output schema and no annotations means the description must carry a lot. For a mutation tool with 6 parameters and 33% schema coverage, it covers the essential behaviors (sort, file modification, header handling, safe column referencing) quite well. However, it doesn't address edge cases like missing header handling, whether sort is stable, or behavior with merged cells/blank key cells. Adequate but leaves room.

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 description coverage is only 33% (only filePath and range have schema descriptions). The description compensates by explaining the hasHeader parameter's role ('用表头名指定列更稳妥'), which adds value beyond the plain boolean schema. keyColumn semantics ('按某列排序') are clarified implicitly. Good compensation for low schema coverage, though keyColumn format could be more explicit.

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?

Description states '对一个区域按某列排序' (sort a range by a column), with a specific verb+resource. It distinguishes sorting (reorders rows) from siblings like filter_range and dedupe_range via the phrase '会修改文件' and '区域外的内容不动'. However, it doesn't explicitly contrast with the closest siblings, so it stops short of 5.

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 clear use context: mentions '有表头时传 hasHeader: true 并用表头名指定列更稳妥' (when header exists, use hasHeader:true and specify column by header name is safer). This gives practical guidance on when to set flags. However, it doesn't explicitly say when NOT to use this tool or name alternative tools for other scenarios, slightly short of 5.

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

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