Skip to main content
Glama

MiaoToolbox (妙用盒)

日期与工作日计算(妙用盒)

calculate_date
Read-onlyIdempotent

确定性日历与工作日计算(1900-2100年,内置 2025-2027 中国国务院办公厅法定节假日与调休补班)。支持 3 种操作:1) action="diff" 计算两个日期间隔天数与工作日数;2) action="offset" 从基准日加减 N 个工作日/自然日/周/月/年推算目标日期;3) action="inspect" 查询单日星期、是否工作日、法定假日/补班及年内天数。

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": {
      "action": "<action>"
    },
    "name": "calculate_date"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNo【inspect】要查询的日期 YYYY-MM-DD
unitNo【offset】偏移单位workdays
deltaNo【offset】加减数量(负数往前倒推)
actionYes计算类型:diff(日期间隔)/ offset(日期加减推算)/ inspect(单日属性查询)
endDateNo【diff】结束日期 YYYY-MM-DD
baseDateNo【offset】基准日期 YYYY-MM-DD
startDateNo【diff】开始日期 YYYY-MM-DD
includeEndNo【diff】是否包含结束日(默认 true,两头都算)
workdayRuleNo工作日规则:cn_official(中国法定节假日含调休,默认)或 standard(周一至周五)cn_official

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, openWorldHint=false and destructiveHint=false, so safety is covered; the description adds genuinely new behavioral facts: results are deterministic, inputs are bounded to 1900-2100, and the Chinese holiday table only covers 2025-2027. It also discloses the default workday rule (cn_official with make-up workdays) that drives offset/diff counting, which is exactly the kind of non-obvious behavior an agent needs.

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?

One tight paragraph with the scope constraints front-loaded before the numbered breakdown of actions; every clause carries information and there is no filler. The numbered enumeration slightly duplicates the action enum, which keeps it just short of ideal.

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?

With 9 parameters, one required, three actions, and no output schema, the description does the necessary work by sketching what each action returns (interval days and workday counts, a projected target date, weekday/holiday/year-day attributes). The remaining gap is undefined behavior outside the stated bounds, i.e. what cn_official does for dates beyond 2027 or outside 1900-2100.

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%, and the schema already tags each parameter with its owning action (【diff】/【offset】/【inspect】), so the description's action-to-parameter mapping largely restates structured data. It adds no syntax, format, or edge-case detail (e.g. how includeEnd interacts with workday counts, or clamping behavior when delta crosses the supported range), so the baseline 3 applies.

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 names a specific verb+resource (deterministic calendar/workday calculation) and immediately enumerates the three supported operations with their action values (diff / offset / inspect). It also states the supported year range (1900-2100) and the built-in holiday dataset (2025-2027 State Council holidays and make-up workdays), so an agent can distinguish this from sibling calculators 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 three action values are each paired with the scenario they serve (interval counting, forward/backward projection, single-day attribute lookup), which is clear in-tool routing guidance. What is missing is any exclusion or sibling differentiation, e.g. when to prefer this over convert_timezone for time-related questions, or that it is not a date formatter.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources