Skip to main content
Glama

Formatear fecha y hora

datetime-format
Read-onlyIdempotent

Formatea una fecha/hora en una zona e idioma con estilos Intl o un patrón (YYYY MM DD HH mm…). Cuándo: un resultado de fechas, zonas horarias o calendario tiene que ser exacto (desfases, horario de verano, fines de mes, bisiestos). No para: analizar una fecha/hora ISO 8601 o RFC 2822 en sus partes (datetime-parse). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Formats an instant in a time zone and locale, either with Intl styles (full/long/medium/short) or a pattern (YYYY MM DD HH mm ss SSS MMMM ddd dddd hh A Z; [text] for literals). When: a date, time-zone or calendar result has to be exact (offsets, daylight saving, month ends, leap years). Not for: parsing an ISO 8601 or RFC 2822 date-time into its parts (datetime-parse). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
styleNoIntl style (ignored when pattern is set) (optional; one of: full, long, medium, short; default "long").long
localeNoBCP 47 locale (string; optional; default "en-US"; up to 35 chars; pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$).en-US
patternNoPattern (string; optional; up to 200 chars).
datetimeYesISO 8601 date-time (with Z/offset, or naive local time in `timezone`) or YYYY-MM-DD (string; required; up to 40 chars).
timezoneNoIANA time zone, e.g. America/Bogota (default UTC) (string; optional; default "UTC"; up to 64 chars).UTC

Output Schema

NameRequiredDescriptionDefault
formattedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / datetime / examples
      Added value: +[
      +  "2026-10-31T14:05:09Z"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Formats an instant in a time zone and locale, either with Intl styles (full/long/medium/short) or a pattern (YYYY MM DD HH mm ss SSS MMMM ddd dddd hh A Z; [text] for literals). When: a date, time-zone or calendar result has to be exact (offsets, daylight saving, month ends, leap years). Not for: parsing an ISO 8601 or RFC 2822 date-time into its parts (datetime-parse). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, and closed-world behavior. The description adds useful operational context beyond that, notably determinism and explicit limits (64 KB input, 1 s per call, 1 MB result), though it also repeats the no-side-effects point already covered by annotations.

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?

The content is front-loaded and well-structured into purpose, when, not-for, side effects, determinism, and limits. It is somewhat longer than necessary because the Spanish and English versions duplicate the same information.

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?

With annotations, full schema coverage, and an output schema already present, the description supplies everything needed: purpose, routing guidance, determinism, and resource limits. Return-value explanation is unnecessary because an output schema exists.

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. The description still adds value by explaining the pattern token vocabulary and bracketed literals, which the schema only describes generically as an optional pattern string.

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: formatting an instant in a time zone and locale using Intl styles or a pattern. It explicitly distinguishes itself from the parsing sibling datetime-parse, so an agent can route correctly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use conditions (exact date, time-zone, or calendar results involving offsets, DST, month ends, leap years) and explicitly excludes parsing into parts, naming datetime-parse as the alternative.

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