Skip to main content
Glama

date_duration

Read-onlyIdempotent

The exact duration between two dates or date-times: calendar years/months/days, plus total days, hours, minutes and seconds, and the number of weekdays (Mon-Fri). Handles leap years and DST via the IANA database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYesEnd date/time (ISO 8601 or Unix timestamp).
startYesStart date/time (ISO 8601 or Unix timestamp).
timezoneNoIANA time zone, e.g. "America/New_York". Defaults to UTC.
include_endNoCount the end date as a full day (adds one day). Default false.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYesOne instant described in one IANA time zone.
daysYes
hoursYes
humanYesCalendar duration in words, e.g. "1 year, 2 months, 3 days".
startYesOne instant described in one IANA time zone.
yearsYes
monthsYes
minutesYes
secondsYes
weekdaysYesMonday to Friday days in the span.
directionYes
total_daysYes
total_hoursYes
weekend_daysYes
total_minutesYes
total_secondsYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "days": {
      +      "type": "integer"
      +    },
      +    "direction": {
      +      "enum": [
      +        "forward",
      +        "backward"
      +      ],
      +      "type": "string"
      +    },
      +    "end": {
      +      "description": "One instant described in one IANA time zone.",
      +      "properties": {
      +        "abbreviation": {
      +          "description": "Zone abbreviation at that instant, e.g. \"BST\".",
      +          "type": "string"
      +        },
      +        "epoch_millis": {
      +          "description": "Unix time in milliseconds.",
      +          "type": "integer"
      +        },
      +        "epoch_seconds": {
      +          "description": "Unix time in seconds.",
      +          "type": "integer"
      +        },
      +        "human": {
      +          "description": "Readable sentence with weekday, date, time and zone.",
      +          "type": "string"
      +        },
      +        "is_dst": {
      +          "description": "Whether daylight-saving time is in effect.",
      +          "type": "boolean"
      +        },
      +        "iso": {
      +          "description": "ISO 8601 with the zone offset.",
      +          "type": "string"
      +        },
      +        "offset": {
      +          "description": "UTC offset, e.g. \"+09:00\".",
      +          "type": "string"
      +        },
      +        "offset_minutes": {
      +          "description": "UTC offset in minutes.",
      +          "type": "integer"
      +        },
      +        "rfc2822": {
      +          "description": "RFC 2822 date string.",
      +          "type": "string"
      +        },
      +        "timezone": {
      +          "description": "IANA zone name.",
      +          "type": "string"
      +        },
      +        "utc_iso": {
      +          "description": "ISO 8601 in UTC (Z).",
      +          "type": "string"
      +        },
      +        "weekday": {
      +          "description": "Full weekday name in English.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "epoch_seconds",
      +        "epoch_millis",
      +        "iso",
      +        "utc_iso",
      +        "timezone",
      +        "offset",
      +        "offset_minutes",
      +        "abbreviation",
      +        "is_dst",
      +        "weekday",
      +        "rfc2822",
      +        "human"
      +      ],
      +      "type": "object"
      +    },
      +    "hours": {
      +      "type": "integer"
      +    },
      +    "human": {
      +      "description": "Calendar duration in words, e.g. \"1 year, 2 months, 3 days\".",
      +      "type": "string"
      +    },
      +    "minutes": {
      +      "type": "integer"
      +    },
      +    "months": {
      +      "type": "integer"
      +    },
      +    "seconds": {
      +      "type": "integer"
      +    },
      +    "start": {
      +      "description": "One instant described in one IANA time zone.",
      +      "properties": {
      +        "abbreviation": {
      +          "description": "Zone abbreviation at that instant, e.g. \"BST\".",
      +          "type": "string"
      +        },
      +        "epoch_millis": {
      +          "description": "Unix time in milliseconds.",
      +          "type": "integer"
      +        },
      +        "epoch_seconds": {
      +          "description": "Unix time in seconds.",
      +          "type": "integer"
      +        },
      +        "human": {
      +          "description": "Readable sentence with weekday, date, time and zone.",
      +          "type": "string"
      +        },
      +        "is_dst": {
      +          "description": "Whether daylight-saving time is in effect.",
      +          "type": "boolean"
      +        },
      +        "iso": {
      +          "description": "ISO 8601 with the zone offset.",
      +          "type": "string"
      +        },
      +        "offset": {
      +          "description": "UTC offset, e.g. \"+09:00\".",
      +          "type": "string"
      +        },
      +        "offset_minutes": {
      +          "description": "UTC offset in minutes.",
      +          "type": "integer"
      +        },
      +        "rfc2822": {
      +          "description": "RFC 2822 date string.",
      +          "type": "string"
      +        },
      +        "timezone": {
      +          "description": "IANA zone name.",
      +          "type": "string"
      +        },
      +        "utc_iso": {
      +          "description": "ISO 8601 in UTC (Z).",
      +          "type": "string"
      +        },
      +        "weekday": {
      +          "description": "Full weekday name in English.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "epoch_seconds",
      +        "epoch_millis",
      +        "iso",
      +        "utc_iso",
      +        "timezone",
      +        "offset",
      +        "offset_minutes",
      +        "abbreviation",
      +        "is_dst",
      +        "weekday",
      +        "rfc2822",
      +        "human"
      +      ],
      +      "type": "object"
      +    },
      +    "total_days": {
      +      "type": "integer"
      +    },
      +    "total_hours": {
      +      "type": "integer"
      +    },
      +    "total_minutes": {
      +      "type": "integer"
      +    },
      +    "total_seconds": {
      +      "type": "integer"
      +    },
      +    "weekdays": {
      +      "description": "Monday to Friday days in the span.",
      +      "type": "integer"
      +    },
      +    "weekend_days": {
      +      "type": "integer"
      +    },
      +    "years": {
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "start",
      +    "end",
      +    "direction",
      +    "years",
      +    "months",
      +    "days",
      +    "hours",
      +    "minutes",
      +    "seconds",
      +    "total_days",
      +    "total_hours",
      +    "total_minutes",
      +    "total_seconds",
      +    "weekdays",
      +    "weekend_days",
      +    "human"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already mark this tool as read-only, idempotent, and non-destructive, so the bar for extra disclosure is lower. The description adds valuable behavioral context by explicitly calling out leap-year handling and DST handling via t IANA database, and it lists what the computation includes. No contradiction with annotations exists.

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, no filler; the purpose is front-loaded and the behavioral caveats are compressed into a single closing sentence. 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?

The description covers purpose, supported date types, computation semantics, timezone handling, and output categories. With output schema and annotations covering return shape and safety, nothing important is missing for selecting and invoking the tool.

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 parameter meaning is already fully documented in the input schema. The description does not add any parameter-specific guidance beyond the broader output scope, which is acceptable given the high schema coverage.

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 clearly states the tool computes the exact duration between two dates/times and enumerates specific output categories (calendar units, total units, weekday count), which distinguishes it from date arithmetic siblings like convert_timestamp or epoch_math. It does not explicitly name a sibling or contrast itself, but the purpose is unambiguous.

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?

The description implies the tool should be used whenever a duration between two dates is needed, especially when calendar-aware totals and weekday counts are required. However, it gives no explicit guidance about when to choose this tool over days_until or other sibling date tools, and no exclusions are stated.

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.

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct date/time operation: conversion, timezone shifting, cron scheduling, duration, countdown, arithmetic, parsing, and current time. Even the inverse operations (convert_timestamp vs parse_datetime) are clearly separated by input/output direction.

Naming Consistency3/5

Names are uniformly snake_case and readable, but they mix verb_noun patterns (convert_timestamp, parse_datetime) with noun-phrase or query-style names (date_duration, time_now, days_until, epoch_math, cron_next_runs). This is consistent in style but not in grammatical pattern.

Tool Count5/5

Eight tools is well-scoped for a date/time and epoch calculator. Each tool covers a distinct facet of the domain without redundancy or bloat.

Completeness5/5

The tool surface covers the full lifecycle of date/time operations: current time, parsing, formatting, timezone conversion, arithmetic, duration, countdowns, and cron scheduling. No significant gaps that would block common use cases.

Resources