Skip to main content
Glama

replace_in_column

Replace text patterns in CSV columns using regex or literal strings to clean, transform, or standardize data values.

Instructions

Replace patterns in a column with replacement text.

Returns: ColumnOperationResult with replacement details

Examples: # Replace with regex replace_in_column(ctx, "name", r"Mr.", "Mister")

# Remove non-digits from phone numbers replace_in_column(ctx, "phone", r"\D", "", regex=True) # Simple string replacement replace_in_column(ctx, "status", "N/A", "Unknown", regex=False) # Replace multiple spaces with single space replace_in_column(ctx, "description", r"\s+", " ")

Input Schema

NameRequiredDescriptionDefault
columnYesColumn name to apply pattern replacement in
patternYesPattern to search for (regex or literal string)
replacementYesReplacement text to use for matches
regexYesWhether to treat pattern as regex (True) or literal string (False)

Input Schema (JSON Schema)

{ "properties": { "column": { "description": "Column name to apply pattern replacement in", "type": "string" }, "pattern": { "description": "Pattern to search for (regex or literal string)", "type": "string" }, "regex": { "description": "Whether to treat pattern as regex (True) or literal string (False)", "type": "boolean" }, "replacement": { "description": "Replacement text to use for matches", "type": "string" } }, "required": [ "column", "pattern", "replacement", "regex" ], "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