Skip to main content
Glama

add_column

Add new columns to dataframes with constant values, lists, or computed formulas for data transformation and analysis.

Instructions

Add a new column to the dataframe.

Returns: ColumnOperationResult with operation details

Examples: # Add column with constant value add_column(ctx, "status", "active")

# Add column with list of values add_column(ctx, "scores", [85, 90, 78, 92, 88]) # Add computed column add_column(ctx, "total", formula="price * quantity") # Add column with complex formula add_column(ctx, "full_name", formula="first_name + ' ' + last_name")

Input Schema

NameRequiredDescriptionDefault
nameYesName for the new column to add
valueNoSingle value for all rows or list of values (one per row)
formulaNoSafe mathematical expression to compute column values (e.g., 'col1 + col2')

Input Schema (JSON Schema)

{ "properties": { "formula": { "anyOf": [ { "$ref": "#/$defs/SecureExpression" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Safe mathematical expression to compute column values (e.g., 'col1 + col2')" }, "name": { "description": "Name for the new column to add", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "number" }, { "type": "boolean" }, { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" } ] }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Single value for all rows or list of values (one per row)" } }, "required": [ "name" ], "type": "object" }

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