Skip to main content
Glama

change_column_type

Convert column data types in CSV files to int, float, str, bool, or datetime formats with error handling options.

Instructions

Change the data type of a column.

Returns: ColumnOperationResult with conversion details

Examples: # Convert string numbers to integers change_column_type(ctx, "age", "int")

# Convert to float, replacing errors with NaN
change_column_type(ctx, "price", "float", errors="coerce")

# Convert to datetime
change_column_type(ctx, "date", "datetime")

# Convert to boolean
change_column_type(ctx, "is_active", "bool")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesColumn name to change data type for
dtypeYesTarget data type (int, float, str, bool, datetime)
errorsNoError handling: 'raise' for errors, 'coerce' to replace invalid values with NaNcoerce

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNoWhether operation completed successfully
operationYesType of operation performed
transformNoTransform description
part_indexNoPart index for split operations
nulls_filledNoNumber of null values filled
rows_removedNoNumber of rows removed (for remove_duplicates)
rows_affectedYesNumber of rows affected by operation
values_filledNoNumber of values filled (for fill_missing_values)
updated_sampleNoSample values after operation
original_sampleNoSample values before operation
columns_affectedYesNames of columns affected
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return type ('ColumnOperationResult with conversion details') and shows error handling in examples, but doesn't address important behavioral aspects like whether this operation is destructive, requires specific permissions, or has performance implications for large datasets.

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?

The description is appropriately sized with a clear purpose statement followed by return information and helpful examples. The examples are well-organized and demonstrate common use cases efficiently, though the structure could be slightly improved by separating the purpose statement from the return information more clearly.

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?

Given the tool has an output schema (mentioned in the description) and the input schema has 100% coverage, the description provides adequate context. The examples add practical value, though for a data transformation tool with no annotations, it could benefit from more behavioral context about data integrity implications or performance considerations.

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 has 100% description coverage, so parameters are well-documented in the structured schema. The description adds minimal value beyond what's already in the schema - it shows examples of parameter usage but doesn't provide additional semantic context or edge cases beyond what the schema descriptions already cover.

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 clearly states the tool's purpose with a specific verb ('change') and resource ('data type of a column'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'update_column' or 'transform_column_case', which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_column' or 'transform_column_case'. It includes examples that show common use cases, but lacks explicit when/when-not instructions or prerequisites for usage.

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/jonpspri/databeak'

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