Skip to main content
Glama

Cap Outliers

cap_outliers

Caps numerical outliers by setting values beyond IQR bounds to the bound instead of removing them, while skipping columns with zero IQR. Returns capped counts, bounds, and skipped columns.

Instructions

Winsorize extreme values: values beyond the IQR bounds are set to the bound instead of being removed. Columns where IQR is 0 (flags, one-hot columns) are skipped. Capped columns become float. Args: dataset_id (str): ID of the dataset. columns (list[str], optional): Numerical columns to cap. Default is all numerical columns (consider excluding the target column). Returns: dict: how many values were capped in each column, the bounds used and the skipped columns.

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>"
    },
    "name": "cap_outliers"
  }
}

Input Schema

NameRequiredDescriptionDefault
columnsNo
dataset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/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 burden and largely meets it: it discloses the IQR=0 skip rule, the dtype side effect (capped columns become float), and the shape of the result including bounds and skipped columns. It stops short of saying whether the dataset is modified in place or a new dataset is produced, which matters for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The behavioral rule, the skip rule and the dtype change are front-loaded in three tight sentences, followed by conventional Args/Returns blocks. No sentence is redundant.

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 two-parameter transformation with no output schema, the description covers purpose, defaults, edge cases (IQR=0), return contents and type changes. The missing piece is mutation semantics — whether the original dataset is altered or a copy is returned.

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 description coverage is 0%, so the description must compensate, and it does: dataset_id is identified and columns is documented as optional numerical columns defaulting to all numerical columns, with the practical caveat about excluding the target. The only gap is that the list-of-strings value type is left to the schema.

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?

"Winsorize extreme values: values beyond the IQR bounds are set to the bound instead of being removed" names a specific operation and resource, and the phrase "instead of being removed" implicitly distinguishes it from a row-dropping sibling such as remove_outliers. An agent can tell what this does without opening the schema.

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

Usage Guidelines4/5

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

The description makes the use case clear: cap rather than discard extreme values, and it advises considering excluding the target column. It does not explicitly name remove_outliers/detect_outliers as alternatives or state when-not to use it, so it falls short of a 5.

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