Skip to main content
Glama
yanglinfeng

Memory Bridge

by yanglinfeng

日期差计算

answer_date_diff
Read-onlyIdempotent

Calculate the difference between two dates in total days and broken down into years, months, and days. Handles ISO, YYYY/MM/DD, and Chinese date formats for interval questions.

Instructions

计算两个日期相差的天数与年/月/日拆分。日期支持 ISO、YYYY/MM/DD、中文(2024年3月5日)。涉及"间隔多少天/多久"的问题时调用。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes结束日期
fromYes起始日期
_memoryRequestKeyNo兼容代理注入的内部请求键,用于合并同一次模型工具调用

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered by structured data. The description adds the range of accepted date syntaxes, which is useful but is really input-format information. No handling of ambiguous or malformed dates is disclosed; with annotations carrying the behavioral burden, a 3 is appropriate.

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?

Three tight clauses: what is computed, what input formats are tolerated, and when to trigger it. Nothing is padded and the core purpose is front-loaded.

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?

There is no output schema, and the description compensates by stating the return shape (day count plus Y/M/D decomposition). For a two-parameter read-only utility with full annotation coverage, this is essentially complete; only edge cases such as reversed or unparseable dates are unaddressed.

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

Parameters4/5

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

Schema coverage is 100% and both required parameters carry their own descriptions (起始日期 / 结束日期), so the baseline is 3. The description goes beyond that by enumerating the accepted date formats (ISO, YYYY/MM/DD, Chinese 2024年3月5日), which materially helps an agent format the inputs correctly.

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?

States a specific verb and resource — computing the difference between two dates — and even specifies the output shape (total days plus a year/month/day breakdown), which distinguishes it from the sibling answer_date_shift (which moves a single date) and answer_calculator. An agent can route to it 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?

Gives an explicit trigger condition: call it when the question involves '间隔多少天/多久'. That is clear when-to-use guidance, but it never names answer_date_shift as the alternative or excludes the cases that belong to it, so the routing guidance is one-sided.

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