Skip to main content
Glama

ACTION_PARSE_DATETIME

Parses, formats, or retrieves the current date and time with optional day, hour, minute, and second offsets. Use it to convert datetime strings or compute shifted timestamps inside HabitatEngine workflows.

Instructions

取当前时间、解析或格式化日期时间,可加减偏移。输出:datetime_result, datetime_epoch, datetime_year, datetime_month, datetime_day, datetime_hour, datetime_minute, datetime_second, datetime_weekday, datetime_success, datetime_error。按 LocalDateTime 解析,input_format 必须含时间部分(纯日期如 yyyy-MM-dd 会失败);datetime_weekday 1=周一…7=周日。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
inputNoparse/format 时必填:日期时间字符串,format 也可给毫秒时间戳;支持 ${var}
actionNonow=当前时间,parse=解析字符串,format=格式化(默认 now)
formatNo输出格式(java.time 模式)(默认 yyyy-MM-dd HH:mm:ss)
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
add_daysNo加减天数(可为负)(默认 0)
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
add_hoursNo加减小时(可为负)(默认 0)
output_varNo格式化结果变量名(默认 datetime_result)
add_minutesNo加减分钟(可为负)(默认 0)
add_secondsNo加减秒数(可为负)(默认 0)
input_formatNoinput 的格式(java.time 模式)(默认 yyyy-MM-dd HH:mm:ss)
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does a fair job: it discloses the parse engine (LocalDateTime), the hard failure mode for date-only formats, weekday numbering (1=Monday…7=Sunday), ${var} interpolation on string params, and that results are returned as a variable snapshot JSON rather than a direct return value. It does not discuss what happens on error beyond the schema's on_error, but the mutation-to-workflow-variables side effect is disclosed.

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

Conciseness3/5

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

Purpose is correctly front-loaded in the first clause, but the middle is a flat run-on enumeration of eleven output field names that interrupts the flow, and there is a stray doubled period ('。。'). The output list is justified because no output schema exists, yet it could have been condensed into a pattern like datetime_{result,epoch,year,...}.

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 12-parameter, annotation-free tool with no output schema, the definition covers the essentials: what it does, the parse constraint, output variable names, and the interpolation convention. The main remaining gap is the total absence of routing guidance versus ACTION_GET_TIME, which an agent could easily pick instead for a simple 'now' read.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 12 parameters and the baseline is 3. The description adds real value on input_format (must contain a time part, date-only will fail) and on ${var} interpolation across string parameters, but says nothing about the offset params (add_days/hours/minutes/seconds), output_var, require, or node_timeout_ms beyond what the schema states.

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+resource: get current time, parse or format a datetime, with optional offset arithmetic. That is clearly distinct from data-shaping siblings like ACTION_PARSE_JSON or ACTION_MATH, though it never distinguishes itself from the obvious sibling ACTION_GET_TIME, which overlaps on 'now'.

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 is only implied — the reader can infer parse vs format vs now from the action semantics. There is one genuinely useful usage constraint (input_format must include a time component, so pure yyyy-MM-dd fails), but no statement of when to prefer this over ACTION_GET_TIME or ACTION_WAIT_UNTIL_TIME.

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