Skip to main content
Glama
nmhaaa3218

Tu Vi Horoscope MCP Server

convert_calendar

Convert dates between Solar and Lunar calendars, including leap months and timezone offsets, to prepare lunar dates for Tu Vi transit assessments.

Instructions

Convert a date between the Solar (Dương lịch) and Lunar (Âm lịch) calendars.

Purpose and Comparison

Use this tool to translate dates back and forth between Solar and Lunar systems.

  • CRITICAL FOR TRANSIT ASSESSMENTS: Since Tu Vi transit calculations (sao lưu, Đại Hạn, Tiểu Hạn, Nguyệt Hạn) operate strictly on the Lunar calendar, you MUST convert any Solar target periods (e.g. "October 2026") using this tool before calling get_van_han.

  • Do NOT use this tool if you only need base chart calculation, as chart generation tools (generate_horoscope) already handle birth date conversions internally.

Side Effects, Auth, and Rate Limits

  • Side Effects: None. This is a pure mathematical calculation.

  • Auth/Rate Limits: Runs entirely locally. No authentication or external rate limits apply.

Prerequisites

  • The date to convert must represent a valid Gregorian or Vietnamese Lunar date within calendar ranges (typically 1900-2100).

Parameter Guidelines & Interactions

  • day: Day of the date to convert (1-31).

  • month: Month of the date to convert (1-12).

  • year: Year of the date to convert (four-digit year).

  • from_solar: If True (default), converts Solar to Lunar. If False, converts Lunar to Solar.

  • lunar_leap: Only applicable when from_solar=False. Set to True if the source Lunar month is a leap month (tháng nhuận); otherwise False.

  • timezone: Numeric UTC offset (default 7 for ICT / Vietnam). Accepts integer (e.g. 8) or h:30 string (e.g. "8:30"). Other minutes values and out-of-range inputs are rejected.

Output Schema and Error Conditions

  • Returns: A dictionary containing:

    • If from_solar is True: lunar_day, lunar_month, lunar_year, lunar_leap (bool), and formatted string date (e.g. "14/5/1995" or "14/5/1995 (nhuận)").

    • If from_solar is False: solar_day, solar_month, solar_year, and formatted string date.

  • Errors: Returns {"error": "error_message"} if date arguments are out of bounds, fail calendar validation, or timezone is malformed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dayYes
yearYes
monthYes
timezoneNo
from_solarNo
lunar_leapNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.4.1
    • addedInput schema / properties / timezone / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / timezone / default
      Previous value: -7New value: +null
    • removedInput schema / properties / timezone / type
      Removed value: -"integer"
  2. Addedv0.1.6

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so: it declares no side effects (pure mathematical calculation), no auth, no rate limits, local execution, and validity ranges (1900-2100). It also discloses error return shape, which is beyond what any structured field provides.

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?

Long but front-loaded and organized under Purpose/Comparison, Side Effects, Prerequisites, Parameters, and Output headings, so each section earns its place. The markdown headers add some bulk, but nothing is redundant copy of the schema.

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 no output schema, the description supplies return keys for both directions plus the formatted string and the error shape, and no annotations means it correctly covers safety/auth. Nothing an agent needs to invoke or interpret this tool is missing.

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?

Schema description coverage is 0%, so the description must compensate and does for all six parameters. It gives ranges (day 1-31, month 1-12, four-digit year), the conditional semantics of lunar_leap (only when from_solar=False, leap month), and timezone format specifics (integer or 'h:30' string, defaults to 7 ICT, rejected otherwise).

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+resource ('Convert a date between the Solar and Lunar calendars') up front. It further differentiates from siblings by naming get_van_han (a downstream consumer) and generate_horoscope (which handles conversions internally), so an agent can tell exactly where this tool fits.

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?

Explicit when-to-use ('CRITICAL FOR TRANSIT ASSESSMENTS ... MUST convert Solar target periods before calling get_van_han') and when-not-to-use ('Do NOT use this tool if you only need base chart calculation'). Alternatives are named rather than implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.