check_category_columns
Identify categorical columns in your dataset to prepare data for linear regression analysis.
Instructions
This function check if data has categorical columns.
Returns: String which contains list of categorical columns.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_category_columns"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:82-97 (handler)The handler function for the 'check_category_columns' tool. It is decorated with @mcp.tool() to register it as an MCP tool. The function retrieves the data from the global context, selects categorical columns (object or category types), and returns a message listing them or indicating none exist.
@mcp.tool() def check_category_columns() -> str: """ This function check if data has categorical columns. Returns: String which contains list of categorical columns. """ categorical_data = context.get_data().select_dtypes(include=["object", "category"]) if not categorical_data.empty: return f"Data has following categorical columns: {", ".join(categorical_data.columns.to_list())}" else: return f"Data has no categorical columns."