Skip to main content
Glama

Log Transform

log_transform

Applies log transforms to selected numerical columns to reduce right skew, with methods such as log1p, log, log10, and log2 while returning skewness before and after.

Instructions

Log-transform numerical columns. This is the usual fix for right-skewed columns such as prices, counts, distances and incomes. Columns must be passed explicitly so the target is never transformed by accident. Args: dataset_id (str): ID of a dataset or of a split. columns (list[str]): Numerical columns to transform. method (str): "log1p" (log(1 + x), safe for zeros), "log", "log10" or "log2". Default is "log1p". offset (float): Constant added before the log, e.g. to shift columns that contain 0 or negatives. Default is 0. replace (bool): Overwrite the original columns instead of adding "_". Default is False. Returns: dict: The new columns and the skewness before and after (measured on the training rows).

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": {
      "dataset_id": "<dataset_id>",
      "columns": "<columns>"
    },
    "name": "log_transform"
  }
}

Input Schema

NameRequiredDescriptionDefault
methodNolog1p
offsetNo
columnsYes
replaceNo
dataset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses mutation semantics (replace=False adds new '<column>_<method>' columns rather than overwriting), the order of operations for offset, and that returned skewness is measured on training rows. It omits failure behavior, such as what happens with non-numeric columns or with zero or negative values when no offset is supplied.

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 front-loaded with purpose and the statistical rationale before the Args block, and each parameter line adds distinct information rather than restating types. The prose is a little long, but no sentence is pure filler.

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?

For a five-parameter mutation tool with no annotations and no output schema, the description covers purpose, all parameters, defaults, column-naming side effects, and the shape of the returned dict, so an agent could invoke it correctly. It is slightly incomplete on error conditions and on whether the new columns must later be dropped or dropped automatically.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must document all five parameters, and it does — including the meaning of dataset_id as 'a dataset or a split', the four allowed method values with a safety rationale for log1p, and the practical purpose of offset for zero or negative values. This is meaningfully richer than the bare JSON types and defaults in the schema.

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 opens with a specific verb and resource ('Log-transform numerical columns') and immediately characterizes when it is the right fix ('right-skewed columns such as prices, counts, distances and incomes'). It does not explicitly distinguish itself from the sibling transform_feature, so it falls short of a 5.

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

Usage Guidelines3/5

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

It gives implied usage guidance by naming the statistical situation (right-skew) that this transform addresses, and it includes a safety rule ('columns must be passed explicitly so the target is never transformed by accident'). It stops short of naming an alternative tool or stating when not to use this one, so the guidance remains implicit rather than explicit routing.

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

Deploy Server

Other Tools