Skip to main content
Glama

Extract Date Features

extract_date_features

Split date or datetime columns into numerical features for machine learning, including year, month, weekday, quarter, and optional cyclical encodings; unparseable values become missing.

Instructions

Split a date/datetime column into numerical parts that models can use. Values that cannot be parsed become missing values (the call fails if more than half cannot be parsed). Args: dataset_id (str): ID of a dataset or of a split. column (str): Date column (text or datetime). features (list[str], optional): Parts to extract. Choose from: year, month, day, dayofweek, dayofyear, weekofyear, quarter, hour, minute, is_weekend, is_month_start, is_month_end, epoch_days. Default is year, month, day, dayofweek, is_weekend, quarter. drop_original (bool): Drop the original date column. Default is True. cyclical (bool): Also add "_sin" and "_cos" columns for cyclic parts (month, dayofweek, hour, ...) so that e.g. December and January are close. Default is False. date_format (str, optional): strftime format such as "%d/%m/%Y". Recommended when dates are not ISO formatted. Returns: dict: The new columns, and any extracted parts that are constant (e.g. hour for date-only data).

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

Input Schema

NameRequiredDescriptionDefault
columnYes
cyclicalNo
featuresNo
dataset_idYes
date_formatNo
drop_originalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 does well: it discloses that unparseable values become missing, that the call fails when more than half fail, that drop_original defaults to True (a destructive side effect on the input column), and that constant extracted parts are reported back. It omits any note on permissions, cost, or whether the operation mutates the dataset in place.

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?

Front-loaded purpose followed by a structured Args block and a Returns line; every entry adds information an agent cannot get from the bare schema. Minor redundancy in restating defaults (drop_original, cyclical) already present in the schema, but that is defensible given zero schema descriptions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter transform with no annotations and no output schema, the description covers the failure mode, the mutation of the source column, the return shape, and all parameter semantics. An agent could call this correctly without opening the schema.

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 compensate, and it does: every one of the six parameters is explained, including defaults and the full enumerated list of valid feature names (year, month, dayofweek, is_weekend, epoch_days, ...) which exists nowhere in the schema. It also explains the semantics of cyclical (sine/cosine columns so December and January are close) and gives a concrete date_format example.

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-plus-resource: 'Split a date/datetime column into numerical parts that models can use.' That is unambiguous about what is produced. It does not name or differentiate from any sibling (e.g. create_feature), so it falls short of the top score.

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?

Usage context is implied rather than stated: it explains the parse-failure path and advises date_format 'when dates are not ISO formatted,' which is a real conditional guideline for one parameter. There is no guidance on when to pick this over sibling feature-creation tools or on prerequisites for dataset_id (dataset vs split).

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