Skip to main content
Glama

extract_datetime_parts

Extract datetime components like year, month, dayofweek, and is_weekend into new columns for feature engineering, preserving the original column.

Instructions

Extract datetime components as new columns ({column}_year, {column}_month, etc.). Parts: year, month, day, dayofweek, hour, minute, weekofyear, quarter, is_weekend. Use early in feature engineering when datetime columns exist. year, month, dayofweek, is_weekend are often highly predictive. Original column is preserved. Example: extract_datetime_parts(column="date", parts=["year", "month", "dayofweek", "is_weekend"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partsNo
columnYes
df_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden for behavioral disclosure. It does mention 'Original column is preserved' and the naming convention, which is useful. However, it does not clarify what happens when 'parts' is null (the schema default), nor does it address invalid datetime formats or whether the operation modifies the dataframe in place. These gaps leave some ambiguity.

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 description is four sentences, each earning its place: purpose, available parts, usage guidance, and an example. It is front-loaded with the core action and avoids redundancy.

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

Completeness3/5

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

The tool is moderately complex with 3 parameters and an output schema, but the description lacks details about df_name and default parts behavior. The use case and example are helpful, but an agent needs more information to invoke the tool correctly in all scenarios, especially since there are no annotations and schema descriptions are empty.

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

Parameters2/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 explain all parameters. It adds meaning for 'column' via the example and naming pattern, and for 'parts' by enumerating possible string values. However, it completely omits any explanation of the 'df_name' parameter, and the default behavior of 'parts' (null) is not explained. This fails to fully compensate for the lacking schema descriptions.

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?

The description clearly states the tool 'Extract datetime components as new columns' with a concrete naming pattern and lists the exact components (year, month, day, etc.). This distinguishes it from sibling datetime tools like datetime_diff, datetime_filter, and set_datetime_index, which have different purposes.

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?

It gives clear usage context: 'Use early in feature engineering when datetime columns exist' and even highlights which parts are 'often highly predictive.' It does not explicitly state when not to use it or name alternatives, but the context is sufficient for an agent to select this tool appropriately.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AstyanM/mcp-data-science'

If you have feedback or need assistance with the MCP directory API, please join our Discord server