Skip to main content
Glama

Time of Meeting

Next weekday in a month

next_occurrence
Read-onlyIdempotent

Find the next date on or after start that is the first, second, third, fourth, fifth, or last given weekday of its month. Use for questions like the date of the last Friday of the month. weekday is Mon, Tue, Wed, Thu, Fri, Sat, or Sun. start defaults to today (UTC). Example: start 2026-10-23, weekday Fri, occurrence last is 2026-10-30, the last Friday of October. If that month's occurrence is before start, the answer is in a later month: the first Monday on or after 2026-10-23 is 2026-11-02. A fifth weekday that the month does not have is skipped. The result is that date, its month, iso_week, and us_week. The request is not repeated.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "weekday": "<weekday>",
      "occurrence": "<occurrence>"
    },
    "name": "next_occurrence"
  }
}

Input Schema

NameRequiredDescriptionDefault
startNoSearch from this date, inclusive. Defaults to today (UTC). Also accepted: YYYY-MM-DDTHH:MM, YYYY-MM-DDTHH:MM:SSZ, YYYY/MM/DD, or YYYYMMDD.
weekdayYesMon, Tue, Wed, Thu, Fri, Sat, or Sun.
occurrenceYesWhich of that weekday in the month. last is the final one.

Output Schema

NameRequiredDescriptionDefault
dateYes
errorNo
monthYes
weeksYesISO week (Monday start; week 1 contains the year's first Thursday) and US week (Sunday start; 1 January is week 1 of that calendar year).
candidatesNo
zone_notesNoPresent when a city argument was a time zone abbreviation or fixed offset such as EST or UTC+2. Says which time zone it was read as, and what else the abbreviation can mean.
alternativesNoOther cities that matched the same name, after the best-ranked city was chosen. The order is the site search order: match, then priority, then population.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / zone_notes
      Added value: +{
      +  "description": "Present when a city argument was a time zone abbreviation or fixed offset such as EST or UTC+2. Says which time zone it was read as, and what else the abbreviation can mean.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / start / description
      Previous value: -"Search from this date, inclusive. Defaults to today (UTC)."New value: +"Search from this date, inclusive. Defaults to today (UTC). Also accepted: YYYY-MM-DDTHH:MM, YYYY-MM-DDTHH:MM:SSZ, YYYY/MM/DD, or YYYYMMDD."
  3. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's job is to add semantics beyond that, and it does: default start of today (UTC), rollover to a later month when the occurrence precedes start, and skipping of fifth weekdays a month lacks. The closing sentence 'The request is not repeated' is unclear about output echoing and is the one behavioral point left muddy.

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 definition is front-loaded with the core semantics and the examples are tightly paired (last Friday vs. the first Monday rollover), so length is largely earned. Minor waste comes from restating the weekday enumeration and the start default, which the schema already carries verbatim.

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 an output schema present, the description needn't detail return values, yet it still names them (date, month, iso_week, us_week), and it covers the two edge cases an agent would otherwise get wrong: month rollover and missing fifth weekdays. Nothing needed to invoke this correctly is absent.

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 earns above that by anchoring parameters in worked values ('start 2026-10-23, weekday Fri, occurrence last is 2026-10-30') and by clarifying that 'last' means the final such weekday and that start is inclusive. It doesn't add format variants for start (the schema does), so it stays at 4.

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+resource definition: 'Find the next date on or after start that is the first, second, third, fourth, fifth, or last given weekday of its month.' That fully specifies scope (on-or-after start, within-month ordinal, weekday) and is clearly distinguishable from arithmetic siblings like add_days or week_number.

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?

It gives a concrete use case ('questions like the date of the last Friday of the month') and two worked examples that show the rollover case, which effectively tells the agent when this tool is the right pick. It stops short of naming an alternative sibling or stating explicit exclusions, so it lands at 4 rather than 5.

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