Skip to main content
Glama

Impute Missing

impute_missing

Fill missing dataset values using mean, median, most-frequent, constant, or KNN strategies. Optionally restrict filling to training data via a split ID to prevent data leakage.

Instructions

Fill missing values. Recommended: use a split_id so the fill values come from training data only. Args: dataset_id (str): ID of a dataset or of a split. columns (list[str], optional): Columns to impute. If omitted, all columns with missing values. strategy (str): "auto" (median for numerical, most_frequent for categorical), "mean", "median", "most_frequent", "constant" or "knn" (numerical only). fill_value (int, float or str, optional): Value used by "constant" (default 0 for numerical, "missing" for categorical). n_neighbors (int): Neighbours used by "knn". Default is 5. Returns: dict: Columns imputed, missing counts before, and the value used for each column.

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": "impute_missing"
  }
}

Input Schema

NameRequiredDescriptionDefault
columnsNo
strategyNoauto
dataset_idYes
fill_valueNo
n_neighborsNo

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 burden and mostly succeeds: it discloses the implicit defaults behind "auto" (median for numerical, most_frequent for categorical), the constant-fill defaults per dtype, the knn restriction to numerical columns, and the return payload contents. The notable gap is whether the dataset is mutated in place or a modified copy is produced, which matters for a transformation of this kind.

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 Args/Returns layout is front-loaded and scannable, with no marketing filler. There is minor redundancy where defaults (n_neighbors=5, fill_value defaults) are restated alongside the schema, but it is not costly.

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 5-parameter transformation tool with no annotations and no output schema, the description supplies the strategy semantics, defaults, and an explicit Returns section, which is close to what an agent needs. Only the in-place versus copy behavior and any failure cases (e.g., knn on categorical data, all-null columns) remain unstated.

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%, yet the description documents all five parameters with types, allowed strategy values and their meanings, and defaults (fill_value 0/"missing", n_neighbors 5). It even adds the nuance that dataset_id may refer to either a dataset or a split, which the schema's bare string type does not convey.

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 ("Fill missing values") and the strategy enumeration makes clear it is a general-purpose imputer covering all the single-strategy siblings. It never explicitly distinguishes itself from siblings like drop_missing or fill_missing_mean, so an agent must infer the differentiation from the strategy list alone.

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?

The one piece of guidance — "use a split_id so the fill values come from training data only" — is valuable and addresses train/test leakage, a real usage decision. However, there is no guidance on when to choose this tool over drop_missing or the dedicated fill_missing_mean/median/mode tools, and no indication of prerequisites or ordering within a pipeline.

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