Skip to main content
Glama

Add or subtract time

date_add
Read-onlyIdempotent

Adds or subtracts a duration (years, months, weeks, days, hours, minutes, seconds) to a date/time. Use negative numbers to subtract. Calendar-aware: adding 1 month to Jan 31 gives Feb 28/29, and adding days keeps the same local clock time across daylight-saving changes.

Input Schema

NameRequiredDescriptionDefault
daysNodays to add (negative to subtract)
hoursNohours to add (negative to subtract)
weeksNoweeks to add (negative to subtract)
yearsNoyears to add (negative to subtract)
monthsNomonths to add (negative to subtract)
minutesNominutes to add (negative to subtract)
secondsNoseconds to add (negative to subtract)
datetimeYesDate/time in ISO 8601 (e.g. "2026-03-08T14:30", "2026-03-08T14:30:00Z", "2026-03-08"), "YYYY-MM-DD HH:mm", a Unix timestamp in seconds or milliseconds, or "now".
timezoneNoTime zone the arithmetic happens in. IANA time zone name, e.g. "America/New_York", "Europe/London", "Asia/Tokyo", or "UTC". Fixed offsets like "UTC+5:30" also work. Defaults to UTC.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare the readOnly/idempotent/non-destructive profile, and the description goes well beyond them by disclosing calendar semantics that are not derivable from structured fields: month-end clamping (Jan 31 + 1 month = Feb 28/29) and DST-stable local clock time for day arithmetic.

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?

Two sentences, zero filler, with the core behavior and the subtraction convention front-loaded before the edge-case semantics. Every clause earns its place.

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?

Nine parameters with 100% schema coverage and no output schema, so the description needs only to convey behavior and conventions. It covers direction of arithmetic, units, and the non-obvious calendar/DST edge cases; safety is fully handled by annotations.

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%, so the baseline is 3, but the description adds real meaning by tying day arithmetic to timezone/DST behavior and enumerating the full unit set as a coherent group rather than isolated params. It does not add new format or default details beyond the schema.

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 pair (adds/subtracts) and resource (duration to a date/time), and the unit list in parentheses makes the scope concrete. An agent can distinguish it from date_diff 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?

Explicitly tells the agent to use negative numbers to subtract, which is genuine invocation guidance. It stops short of naming date_diff or stating when this tool is preferred over alternatives, so it is clear context without exclusions.

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