Skip to main content
Glama

ISO Week Number

ISO Week Number

run
Read-only

Converts between calendar dates and ISO 8601 week numbers, in either direction, and reports how many weeks an ISO year has.

Use this whenever a date needs to be expressed as a week number, or a week number needs to be turned back into a date — sprint planning, report periods, "week 37" style scheduling, or reconciling two systems that disagree about what week it is.

DO NOT compute this yourself with day-of-year divided by 7. ISO 8601 week 1 is defined as the week (Monday-Sunday) containing the year's first Thursday, not the week containing January 1st. This has two consequences that are easy to get wrong from memory: late-December dates can belong to ISO week 1 of the NEXT calendar year, and early-January dates can belong to ISO week 52 or 53 of the PREVIOUS calendar year. A year has 53 ISO weeks (not the usual 52) exactly when January 1 is a Thursday, or the year is a leap year and January 1 is a Wednesday — a rule nobody carries around, and getting it wrong produces a plausible-looking but incorrect week number with no visible sign of the error.

Input is a single string, and the shape of the string picks the operation: "2027-01-01" a calendar date (YYYY-MM-DD) -> returns its ISO year, week, and weekday "2026-W53" an ISO week, no weekday given -> returns the Monday of that week "2026-W53-5" an ISO week and weekday (1-7, Mon-Sun) -> returns that exact date "2026" a bare 4-digit year -> returns whether it has 52 or 53 ISO weeks

Refuses rather than guesses: slash-separated dates like "03/04/2025" are rejected as ambiguous (month/day vs day/month), two-digit years are rejected as a guess, invalid calendar dates (Feb 30) are rejected, and a week number beyond what that ISO year actually has (e.g. week 53 of a 52-week year) is rejected and told how many weeks that year has.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesA calendar date "YYYY-MM-DD" (e.g. "2027-01-01"), an ISO week "YYYY-Www" or "YYYY-Www-D" where D is 1-7 for Monday-Sunday (e.g. "2026-W53-5"), or a bare 4-digit year (e.g. "2026") to ask how many ISO weeks it has.

Schema Changelog

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

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description comprehensively discloses edge-case behavior: late-December and early-January year rollovers, the 52/53-week rule, and strict rejection of ambiguous or invalid inputs. It also clarifies that the tool 'refuses rather than guesses', giving the agent accurate expectations for failure modes.

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?

The description is long but every section earns its place: statement of purpose, usage guidance, the non-obvious ISO rule, accepted input shapes with return behavior, and rejection semantics. It is front-loaded with the core conversion function and structured so the agent can quickly extract the essential contract.

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?

For a one-parameter function with no output schema, the description fully specifies inputs, outputs, edge cases, and failure behavior. The only thing it omits is a formal output structure, but the per-input return descriptions make that unnecessary for correct invocation.

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

Parameters5/5

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

Although the schema already documents the single 'input' parameter at 100% coverage, the description adds substantial meaning: it explains that the input string's shape selects the operation, shows the exact accepted formats, and details what each format returns (e.g., Monday of the week, exact date, or whether the year has 52/53 weeks). This far exceeds schema-level documentation.

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 opens with a precise verb and resource: converting between calendar dates and ISO 8601 week numbers in either direction, plus reporting week counts per ISO year. It clearly defines the tool's operation and does not rely on the title or name.

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?

It states exactly when to use the tool ('Use this whenever a date needs to be expressed as a week number...') and provides concrete contexts like sprint planning and report periods. It also warns against a plausible but incorrect alternative approach (day-of-year divided by 7), which actively steers the agent away from error.

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.8/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion or misselection. The single tool has a clearly defined purpose and its polymorphic input parsing makes each operation unambiguous.

Naming Consistency3/5

With only one tool there is nothing to be inconsistent with, but the name 'run' is extremely generic and gives no hint of the ISO week domain. It does not follow a descriptive verb_noun convention, though this is mitigated by the exhaustive description.

Tool Count4/5

A single tool for a narrow, well-defined domain is slightly thin but earned its place: it handles all four conversion directions through input-shape dispatch. Splitting into multiple tools would add ceremony without expanding capability.

Completeness5/5

The tool covers the full domain surface: date to ISO week, ISO week to Monday, ISO week with weekday to exact date, and year to week-count. It also rejects ambiguous or invalid inputs rather than guessing, so there are no dead ends or missing operations for the stated purpose.

Resources