Skip to main content

Resolve Time Period (Messaging)

messagingmcp-resolve_time_period

Resolve a natural-language time expression to {start_date, end_date}.

Uses messaging's own season calendar: SS = Mar–Aug; AW/FW = Sep–following Feb; Resort/Cruise = Nov–following Jan. Pass the returned date_range to the promo and search tools rather than embedding the expression in a query string.

Relative expressions ("last week") resolve against now when supplied, so backtesting with a past anchor produces windows relative to that anchor. Future-date handling: a start in the future is unset (open-ended start); an end in the future is clamped to now.

Unusual expressions (named holidays like "Eid"/"Diwali", non-English phrases) that no season/deterministic rule matches fall through to a best-effort LLM parse, flagged is_heuristic=True — surface it for confirmation rather than treating it as an exact filter.

Parameters

NameTypeRequiredConstraintsDescription
expressionstringyesNatural-language time expression, e.g. 'SS25', 'Resort 25', 'last 3 months', 'Black Friday 2024'.
nowstring | nullnodefault: nullAnchor date for relative expressions; defaults to today.

Returns

  • {date_range: {start_date, end_date}, interpretation, is_heuristic}.
  • is_heuristic is True when the heuristic / LLM fallback was used or a
  • future-date rewrite was applied.
  • On parse failure: {"error": str}.

Try it

Loading interactive widget…

Code examples

curl -s https://mcp.edited.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-H "x-api-key: $MCP_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "messagingmcp-resolve_time_period",
"arguments": {
"expression": "example",
"now": null
}
}
}'

Input schema

{
"type": "object",
"properties": {
"expression": {
"description": "Natural-language time expression, e.g. 'SS25', 'Resort 25', 'last 3 months', 'Black Friday 2024'.",
"type": "string"
},
"now": {
"anyOf": [
{
"format": "date",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Anchor date for relative expressions; defaults to today."
}
},
"required": [
"expression"
]
}