Skip to main content
Glama

melt_dataframe

Unpivot wide data into long format for analysis. Keep identifier columns and melt value columns to reshape datasets, enabling compatibility with tools that require long-form data.

Instructions

Unpivot (wide to long format). id_vars are columns to keep, value_vars are columns to melt. Reverse of pivot. Use when data is in wide format but tools expect long format. Example: melt_dataframe(id_vars=["Name","City"], value_vars=["Score","Revenue"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
id_varsYes
var_nameNovariable
value_nameNovalue
value_varsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the transparency burden. It explains the transformation and parameter roles, but does not disclose whether the operation mutates the dataframe or returns a new one, nor any side effects. Adequate but incomplete for a mutation-like 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?

Three concise, well-structured sentences: definition, parameter roles, and a concrete example. No fluff, and the key information is front-loaded.

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 description covers the core transformation, usage guidance, and an example, but lacks details on df_name, var_name, value_name, and side effects. An output schema exists, so return values are likely covered, but the description itself is not fully self-sufficient.

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?

Schema description coverage is 0%, so the description must compensate. It explains id_vars and value_vars with definitions and an example, but leaves df_name, var_name, and value_name unexplained. This partial coverage leaves ambiguity for a 5-parameter tool.

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 'Unpivot (wide to long format)' and explains what id_vars and value_vars do. It distinguishes itself from pivot_table by noting 'Reverse of pivot,' making it easy for an agent to identify when this tool is appropriate.

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?

Explicitly states when to use: 'when data is in wide format but tools expect long format.' Also mentions 'Reverse of pivot,' which implies the alternative (pivot_table). However, it doesn't explicitly list when not to use it.

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