Skip to main content
Glama

Chinese Astrology MCP Server by RoxyAPI

Generate BaZi chart - Four Pillars of Destiny calculator API

post_chinese_astrology_bazi_chart
Read-only

Calculate a complete BaZi chart, the Four Pillars of Destiny, from a birth moment. Returns the year, month, day and hour pillars with every Heavenly Stem and Earthly Branch, the stems hidden inside each branch, the Ten God relation each one holds to the Day Master, the Na Yin sound element of each pair, the five-element balance across the chart, and the combinations and clashes running between the pillars. The day boundary, year boundary and hour clock are all selectable and the applied conventions come back on every response, so a chart is self-describing. Built for astrology apps, matchmaking services, and agents that need a Four Pillars reading they can reproduce.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesBirth date in YYYY-MM-DD format. Sets the year, month and day pillars. The year pillar turns at Beginning of Spring rather than on 1 January, and the month pillar turns at each of the twelve minor solar terms rather than at a calendar month boundary.
langNoResponse language (BCP 47). Supported: en, tr, de, es, hi, pt, fr, ru, zh-Hans, zh-Hant. Defaults to en. Coverage varies by domain, and a field with no translation in the requested language returns English.en
timeYesBirth time in 24-hour HH:MM:SS format. Sets the hour pillar, which is one of the four and carries the whole picture of later life and offspring. Each Earthly Branch covers two hours, so a birth within a few minutes of an odd hour can land in either. All four pillars are read in the local clock of the birth, and the day boundary is applied in that same clock; only the lunisolar calendar date itself is a world constant, fixed at UTC plus 8 so one instant has one Chinese date everywhere.
compactNoSet true for the same data in a compact shape: arrays of same-shaped objects arrive columnar as {"__cols":[names],"__rows":[[values]]}. Lossless, typically 40 to 52 percent fewer tokens.
latitudeNoBirth latitude in decimal degrees. Accepted for consistency with the other birth-data endpoints and does not affect any part of a BaZi chart. Defaults to 0.
timezoneYesIANA name (e.g. "America/New_York", "Europe/London", "UTC"), decimal hours (e.g. -5 for EST, 1 for CET), or a fixed UTC offset (e.g. "-05:00", "+01:00"). Prefer the IANA name: it is resolved to the DST-correct offset for the birth date, while a fixed offset or decimal is taken literally and will be wrong if it does not match the daylight-saving state on that date. Invalid timezones return 400 with a validation error.
hourClockNoWhich clock the HOUR branch is read from. "clock" is civil time exactly as a birth certificate records it, which is what most calculators use and the default here. "local-mean" shifts to the mean sun over the birth longitude, a correction of up to 59 minutes at the edge of a wide time zone. "solar" adds the equation of time on top of that, up to a further 16 minutes. Both non-civil options need "longitude" in the request and return 400 without it.clock
longitudeNoBirth longitude in decimal degrees. Positive is East, negative is West. Required when hourClock is "local-mean" or "solar", which shift the hour branch to the sun over the birth place; omitting it in either case returns 400. Ignored when hourClock is "clock".
dayBoundaryNoWhich instant starts the sexagenary DAY, which only matters for a birth between 23:00 and 23:59. "midnight" is the classical position of the Ming compendium San Ming Tong Hui: the day turns at 00:00 and 23:00 to 23:59 is the late zi hour of the day that is ending, so the hour stem is taken from that day. "early-zi" turns the whole day at 23:00, the practice in Hong Kong, Taiwan and much of South East Asia. "split-zi" is the compromise most software implements and the default here: the day still turns at 00:00, but the hour stem is taken from the next day. The three give three different answers for a late-evening birth and identical answers for every other birth.split-zi
yearBoundaryNoWhich instant starts the sexagenary YEAR. "li-chun" is Beginning of Spring, around 4 February, and is the classical rule every BaZi text uses, so it is the default on this endpoint. "lunar-new-year" is the folk rule people mean when they say which animal they are, and it falls between late January and late February. The two disagree for any birth in the weeks between them: 14 February 2026 is a Wood Snake year under lunar-new-year and a Fire Horse year under li-chun.li-chun

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, and the description's 'Calculate' framing is fully consistent with them — no contradiction. Beyond the annotations, it discloses meaningful behavior: the day/year/hour boundary conventions are selectable, and 'the applied conventions come back on every response, so a chart is self-describing,' which gives agents a reproducibility guarantee. Error semantics (400s, DST resolution, hour ambiguity) are covered in the schema, and the convention-echo disclosure is genuine added context.

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?

Three sentences, each earning its place: what it computes and returns, the selectable-convention behavior, and the intended use cases. The long first sentence is justified because there is no output schema, so the return-value enumeration is the agent's primary window into what the tool produces; there is no fluff or repetition of schema content.

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 10-parameter tool with no output schema, the description is remarkably complete: it enumerates every category of returned data, explains the self-describing convention behavior, and states the intended use cases. The 100%-covered schema supplies validation, defaults, and error semantics. Nothing an agent needs to decide whether to call it and what to expect is missing.

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 description coverage is 100%, so the baseline is 3; the schema already documents all ten parameters in depth, including validation constraints and 400 cases. The tool description adds value by synthesizing the three convention parameters (dayBoundary, yearBoundary, hourClock) into one guarantee — selectable conventions that come back on every response — helping an agent understand how those parameters interrelate and affect reproducibility.

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?

Opens with a specific action and resource: 'Calculate a complete BaZi chart, the Four Pillars of Destiny, from a birth moment.' It then enumerates the full return set — four pillars, every Heavenly Stem and Earthly Branch, hidden stems, Ten God relations, Na Yin sounds, five-element balance, and combinations/clashes — which clearly distinguishes it from the narrower sibling endpoints like bazi_day_master, bazi_luck_pillars, and bazi_annual_forecast without needing their schemas.

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?

The closing sentence gives a clear target scenario: 'Built for astrology apps, matchmaking services, and agents that need a Four Pillars reading they can reproduce.' That is strong contextual guidance for when this endpoint is the right choice. However, it never explicitly names sibling alternatives or states when-not-to-use this tool, so an agent must infer the boundary against the other bazi endpoints.

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

Each tool targets a distinct resource and action: single-day almanac, month view, solar terms, lunar conversion, auspicious day search, zodiac list/profile/compatibility/daily, and BaZi chart/forecast/compatibility/day-master/luck-pillars. Even adjacent calendar and zodiac tools are separated by clear input/output differences, so an agent is unlikely to misselect.

Naming Consistency4/5

All names are snake_case with a consistent get_/post_ prefix, a chinese_astrology domain segment, and predictable subdomain grouping for calendar, zodiac, and bazi. Minor inconsistencies remain, such as zodiac_animals_id versus zodiac_id_daily and calendar_day_date versus calendar_monthly, but the overall pattern is readable and systematic.

Tool Count4/5

16 tools is one above the typical 3–15 sweet spot, but the server covers three distinct subdomains: almanac/calendar, zodiac, and BaZi. Each tool maps to a concrete feature, so the count feels slightly broad rather than bloated, though a few reference lookups could theoretically be consolidated.

Completeness5/5

The tool surface covers the main Chinese astrology workflows end to end: calendar/almanac, lunar conversion, solar terms, auspicious day selection, zodiac profiles, compatibility, daily readings, BaZi chart calculation, day master analysis, luck pillars, annual forecasts, and two-chart compatibility. There are no obvious dead ends or missing operations for the stated domain.

Resources