Skip to main content
Glama

string_clean

Clean text columns by stripping whitespace, changing case, and replacing values to prevent spurious categories before encoding.

Instructions

Clean a string column. Operations applied in order: 'strip', 'lower', 'upper', 'title', 'replace'. For 'replace': uses replace_old and replace_new parameters. Run on text columns BEFORE any encoding. Inconsistent casing or whitespace creates spurious categories. Example: string_clean(column="Name", operations=["strip","lower"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYes
df_nameNo
operationsNo
replace_newNo
replace_oldNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
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 discloses that operations are applied in order and explains the 'replace' operation's dependency on replace_old and replace_new. However, it does not mention whether the operation mutates the dataframe in place, returns a new object, or what happens when 'operations' is null. These are meaningful behavioral gaps.

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 overview, a detail about 'replace', a usage rule, and an example. Every sentence adds value and there is no redundant phrasing. The example is especially useful for an agent.

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?

For a tool with 5 parameters and an output schema, the description covers the core operation, key parameter semantics, and pipeline context. It leaves out df_name and default behavior nuances, but for a string-cleaning utility it is largely self-contained. The presence of an output schema also means return-value details are not required.

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

Parameters3/5

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

The schema provides no property descriptions (0% coverage), so the description must compensate. It explains 'column', 'operations' (with the list of allowed values), and 'replace_old'/'replace_new'. It omits 'df_name', which remains unclear. The example helps but does not fully cover the parameter space.

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?

The description states a specific action and resource: 'Clean a string column', and enumerates the operations it supports ('strip', 'lower', 'upper', 'title', 'replace'). It also distinguishes itself by noting it should be run 'BEFORE any encoding', which separates it from encoding-focused sibling tools. However, it does not explicitly name an alternative tool for contrast, so it stops short of full differentiation.

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 clear usage context: 'Run on text columns BEFORE any encoding' and explains why ('Inconsistent casing or whitespace creates spurious categories'). This gives the agent a concrete trigger condition. It does not mention exclusions or alternative tools, but the context is sufficiently unambiguous.

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