Skip to main content
Glama

cast_column

Change a column's type by deriving a NEW column from it: the fix when a write was refused for retyping a column (-31004). The source column stays as it was: write to the returned new_column_id from then on, and delete_column the original once you have checked the new one. Values that cannot convert become empty unless strict. An impossible cast (a category column only becomes text or a list) is refused naming both types; text is the universal fallback. name defaults to the source's name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model_id": "<model_id>",
      "table_id": "<table_id>",
      "column_id": "<column_id>",
      "to_type": "<to_type>"
    },
    "name": "cast_column"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoName for the new column. Defaults to the source column's name.
strictNoRefuse the whole cast if any value does not convert, instead of leaving those cells empty in the new column. The refusal says how many.
to_typeYesTarget type, in the same spelling `describe_table` reports: "string", "i64", "f64", "bool", "date", … Call `list_column_types` to see which targets this column's current type can actually reach.
model_idYes
table_idYes
column_idYesColumn to cast (a `column_id` from describe_table).
expected_versionNoOptional optimistic-concurrency guard (see edit_rows).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses the crucial behavioral fact that the source column is untouched and the change is staged through a new column, so the agent understands this is additive rather than destructive. It further explains conversion failure semantics (empty cells unless strict), that strict refusals report a count, and that impossible casts are rejected with both type names.

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?

Purpose and the error-code trigger are front-loaded, and every sentence carries actionable content (workflow, conversion rules, type constraints). Sentences are dense with multiple clauses each, which is efficient but slightly harder to scan than a cleaner bulleted structure would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter mutation tool with no output schema, the description covers what an agent needs: there is no return schema, so it names the returned `new_column_id` explicitly, and it closes the loop with the delete_column cleanup step. Remaining gaps (expected_version, model_id) are documented in the schema itself.

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

Parameters4/5

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

Schema coverage is 71%, and the description adds genuine meaning beyond it: the type-reachability rule ("a category column only becomes text or a list") and text as the universal fallback are not in the schema. The `name` default and `strict` conversion behavior largely restate schema text, keeping this short of a 5.

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 opening clause gives a specific verb and resource ("Change a column's type") and immediately clarifies the non-obvious mechanism: it derives a NEW column rather than retyping in place. It also anchors the tool to a concrete failure it resolves (write refused with -31004), which distinguishes it from siblings like add_column or edit_rows.

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

Usage Guidelines5/5

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

It states exactly when to reach for this tool ("the fix when a write was refused for retyping a column (-31004)") and prescribes the follow-up workflow: write to the returned new_column_id, then delete_column the original. It also routes the agent to list_column_types to discover valid targets, leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources