Skip to main content
Glama

clean_cast

Cast columns to specified data types using TRY_CAST, converting non-castable values to NULL instead of failing.

Instructions

New source with columns TRY_CAST to new dtypes per mapping.

    Uses `TRY_CAST` so non-castable values become NULL rather than erroring
    — appropriate for the type-drift workflow where a few outliers are fine.
    Common casts: 'DOUBLE', 'INTEGER', 'BIGINT', 'VARCHAR', 'BOOLEAN', 'DATE'.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasNo
mappingYes
source_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the full burden and discloses a key behavior: non-castable values become NULL instead of erroring. It also notes the output is a new source. It does not mention potential side effects like permission requirements or whether the original source is modified, but 'new source' implies immutability.

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 three sentences: purpose, behavior, and common casts. Each sentence adds value and is front-loaded, with no redundant or vague wording.

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?

The tool has a moderate complexity with an output schema and nested objects. The description covers the main functionality, the NULL behavior, and usable dtype examples. It lacks a brief note on the 'alias' parameter and how to specify multiple columns in the mapping, but overall it is sufficient for an agent to invoke correctly.

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?

Schema description coverage is 0%, so the description must compensate. It explains the core 'mapping' parameter by stating columns are cast per mapping and lists common dtype strings. However, it does not clarify the optional 'alias' parameter or the exact structure of the mapping keys, leaving some ambiguity for the agent.

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 casts columns to new data types using TRY_CAST, creating a new source. It is specific about the verb (TRY_CAST) and the resource (columns to dtypes), distinguishing it from sibling cleaning tools like clean_drop_columns or clean_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?

It provides context that this is appropriate for type-drift workflows where a few outliers are acceptable. It implicitly advises against use when errors should be surfaced, but it does not explicitly name alternative tools or state 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/charliecpeterson/edamcp'

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