Skip to main content
Glama

sort_values

Sort a dataframe by one or more columns to order rows for time-series analysis and visual inspection.

Instructions

Sort the dataframe by one or more columns. Sort before visual inspection or time-series analysis. Useful before plot_line. Example: sort_values(columns=["Revenue"], ascending=False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnsYes
df_nameNo
ascendingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It only states 'Sort the dataframe' without disclosing whether the sorting happens in-place, returns a new dataframe, or has any side effects on the original data. The df_name parameter suggests a data frame context, but the effect is ambiguous. This is a significant behavioral gap for a mutation-capable tool.

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 sentences plus an example, with no unnecessary verbiage. The main purpose is front-loaded, and the example is practical. Every sentence earns its place, and the structure is easy to scan.

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?

For a simple sorting tool, the description is mostly adequate. It tells when to use it and gives an example. However, it omits important context about the df_name parameter and whether the operation mutates or returns a new dataframe. Since there is an output schema (per context signals), return values are not required in the description, but the missing parameter semantics and behavioral transparency leave gaps.

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

Parameters2/5

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

The input schema has 0% description coverage, so the tool description must explain the parameters. It only covers 'columns' (via 'one or more columns') and gives an example with 'ascending'. It does not explain 'df_name' (which is likely needed to specify the dataframe) or clarify the default of 'ascending=true'. The description adds some value but fails to fully compensate for the missing 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 clearly states the action: 'Sort the dataframe by one or more columns.' It names the resource and provides a concrete example with 'sort_values(columns=["Revenue"], ascending=False)'. This is a specific verb+resource and is distinct from sibling tools like filter_rows or drop_duplicates.

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?

The description gives explicit usage context: 'Sort before visual inspection or time-series analysis. Useful before plot_line.' This tells the agent when to use the tool, but it does not explicitly mention when not to use it or name alternatives. It provides clear context without exclusions.

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/AstyanM/mcp-data-science'

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