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.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "date": "1990-06-15",
      "time": "14:30:00",
      "timezone": "America/New_York"
    },
    "name": "post_chinese_astrology_bazi_chart"
  }
}

Input 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", "-06:20:19"). Prefer the IANA name: it is resolved to the offset in force at the birth date and time, historical daylight-saving rules included, while a fixed offset or decimal is taken literally and will be wrong if it does not match the daylight-saving state at that moment. On a transition day a time in the repeated hour is read as its first occurrence and a time in the skipped hour is moved forward past the gap. Before standard time an IANA name reads the local mean time of its reference city, so a birth recorded in local mean time at the birthplace sends that offset: decimal hours equal to the longitude divided by 15 (-6.33876 at 95.0814 W) or the same to the second as "-06:20:19". Invalid timezones return 400 with a validation error.
hourClockNoWhich clock the day boundary and the hour branch are read from, so a correction that carries a birth across midnight moves the day pillar with the hour. "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

Output Schema

NameRequiredDescriptionDefault
pillarsYes
summaryYes
birthDataYes
dayMasterYes
conventionsYes
fiveElementsYes
interactionsYes
zodiacAnimalYes
zodiacAnimalLocalizedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / timezone / description
      Previous value: -"IANA 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 offset in force at the birth date and time, historical daylight-saving rules included, while a fixed offset or decimal is taken literally and will be wrong if it does not match the daylight-saving state at that moment. On a transition day a time in the repeated hour is read as its first occurrence and a time in the skipped hour is moved forward past the gap. Invalid timezones return 400 with a validation error."New value: +"IANA 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\", \"-06:20:19\"). Prefer the IANA name: it is resolved to the offset in force at the birth date and time, historical daylight-saving rules included, while a fixed offset or decimal is taken literally and will be wrong if it does not match the daylight-saving state at that moment. On a transition day a time in the repeated hour is read as its first occurrence and a time in the skipped hour is moved forward past the gap. Before standard time an IANA name reads the local mean time of its reference city, so a birth recorded in local mean time at the birthplace sends that offset: decimal hours equal to the longitude divided by 15 (-6.33876 at 95.0814 W) or the same to the second as \"-06:20:19\". Invalid timezones return 400 with a validation error."
  2. Changed1 schema field changed
    • changedInput schema / properties / hourClock / description
      Previous value: -"Which 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."New value: +"Which clock the day boundary and the hour branch are read from, so a correction that carries a birth across midnight moves the day pillar with the hour. \"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."
  3. Changed1 schema field changed
    • addedOutput schema / properties / pillars / items / properties / naYinElementLocalized
      Added value: +{
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "birthData": {
      +      "properties": {
      +        "date": {
      +          "format": "date",
      +          "type": "string"
      +        },
      +        "latitude": {
      +          "default": 0,
      +          "maximum": 90,
      +          "minimum": -90,
      +          "type": "number"
      +        },
      +        "longitude": {
      +          "maximum": 180,
      +          "minimum": -180,
      +          "type": "number"
      +        },
      +        "time": {
      +          "format": "time",
      +          "type": "string"
      +        },
      +        "timezone": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "date",
      +        "time",
      +        "timezone"
      +      ],
      +      "type": "object"
      +    },
      +    "conventions": {
      +      "properties": {
      +        "dayBoundary": {
      +          "enum": [
      +            "split-zi",
      +            "midnight",
      +            "early-zi"
      +          ],
      +          "type": "string"
      +        },
      +        "hourClock": {
      +          "enum": [
      +            "clock",
      +            "local-mean",
      +            "solar"
      +          ],
      +          "type": "string"
      +        },
      +        "yearBoundary": {
      +          "enum": [
      +            "li-chun",
      +            "lunar-new-year"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "dayBoundary",
      +        "yearBoundary",
      +        "hourClock"
      +      ],
      +      "type": "object"
      +    },
      +    "dayMaster": {
      +      "properties": {
      +        "chinese": {
      +          "type": "string"
      +        },
      +        "element": {
      +          "type": "string"
      +        },
      +        "elementLocalized": {
      +          "type": "string"
      +        },
      +        "nature": {
      +          "type": "string"
      +        },
      +        "pinyin": {
      +          "type": "string"
      +        },
      +        "polarity": {
      +          "type": "string"
      +        },
      +        "stem": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "stem",
      +        "chinese",
      +        "pinyin",
      +        "element",
      +        "polarity",
      +        "nature"
      +      ],
      +      "type": "object"
      +    },
      +    "fiveElements": {
      +      "items": {
      +        "properties": {
      +          "count": {
      +            "type": "number"
      +          },
      +          "element": {
      +            "type": "string"
      +          },
      +          "elementLocalized": {
      +            "type": "string"
      +          },
      +          "level": {
      +            "type": "string"
      +          },
      +          "reading": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "element",
      +          "count",
      +          "level",
      +          "reading"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "interactions": {
      +      "items": {
      +        "properties": {
      +          "chinese": {
      +            "type": "string"
      +          },
      +          "complete": {
      +            "type": "boolean"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "meaning": {
      +            "type": "string"
      +          },
      +          "members": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "pinyin": {
      +            "type": "string"
      +          },
      +          "positions": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "quality": {
      +            "type": "string"
      +          },
      +          "transformsTo": {
      +            "type": "string"
      +          },
      +          "type": {
      +            "type": "string"
      +          },
      +          "variety": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "id",
      +          "chinese",
      +          "pinyin",
      +          "quality",
      +          "positions",
      +          "members",
      +          "meaning"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "pillars": {
      +      "items": {
      +        "properties": {
      +          "branch": {
      +            "properties": {
      +              "animal": {
      +                "type": "string"
      +              },
      +              "animalLocalized": {
      +                "type": "string"
      +              },
      +              "chinese": {
      +                "type": "string"
      +              },
      +              "element": {
      +                "type": "string"
      +              },
      +              "elementLocalized": {
      +                "type": "string"
      +              },
      +              "id": {
      +                "type": "string"
      +              },
      +              "pinyin": {
      +                "type": "string"
      +              },
      +              "polarity": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "chinese",
      +              "pinyin",
      +              "animal",
      +              "element",
      +              "polarity"
      +            ],
      +            "type": "object"
      +          },
      +          "hiddenStems": {
      +            "items": {
      +              "properties": {
      +                "role": {
      +                  "type": "string"
      +                },
      +                "stem": {
      +                  "properties": {
      +                    "chinese": {
      +                      "type": "string"
      +                    },
      +                    "element": {
      +                      "type": "string"
      +                    },
      +                    "elementLocalized": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "pinyin": {
      +                      "type": "string"
      +                    },
      +                    "polarity": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "id",
      +                    "chinese",
      +                    "pinyin",
      +                    "element",
      +                    "polarity"
      +                  ],
      +                  "type": "object"
      +                },
      +                "tenGod": {
      +                  "properties": {
      +                    "category": {
      +                      "type": "string"
      +                    },
      +                    "chinese": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "keynote": {
      +                      "type": "string"
      +                    },
      +                    "name": {
      +                      "type": "string"
      +                    },
      +                    "nameLocalized": {
      +                      "type": "string"
      +                    },
      +                    "pinyin": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "id",
      +                    "name",
      +                    "chinese",
      +                    "pinyin",
      +                    "category",
      +                    "keynote"
      +                  ],
      +                  "type": "object"
      +                }
      +              },
      +              "required": [
      +                "stem",
      +                "role",
      +                "tenGod"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "naYin": {
      +            "type": "string"
      +          },
      +          "naYinChinese": {
      +            "type": "string"
      +          },
      +          "naYinElement": {
      +            "type": "string"
      +          },
      +          "number": {
      +            "type": "number"
      +          },
      +          "position": {
      +            "type": "string"
      +          },
      +          "stem": {
      +            "properties": {
      +              "chinese": {
      +                "type": "string"
      +              },
      +              "element": {
      +                "type": "string"
      +              },
      +              "elementLocalized": {
      +                "type": "string"
      +              },
      +              "id": {
      +                "type": "string"
      +              },
      +              "pinyin": {
      +                "type": "string"
      +              },
      +              "polarity": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "chinese",
      +              "pinyin",
      +              "element",
      +              "polarity"
      +            ],
      +            "type": "object"
      +          },
      +          "tenGod": {
      +            "properties": {
      +              "category": {
      +                "type": "string"
      +              },
      +              "chinese": {
      +                "type": "string"
      +              },
      +              "id": {
      +                "type": "string"
      +              },
      +              "keynote": {
      +                "type": "string"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "nameLocalized": {
      +                "type": "string"
      +              },
      +              "pinyin": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "name",
      +              "chinese",
      +              "pinyin",
      +              "category",
      +              "keynote"
      +            ],
      +            "type": "object"
      +          }
      +        },
      +        "required": [
      +          "position",
      +          "id",
      +          "number",
      +          "stem",
      +          "branch",
      +          "tenGod",
      +          "hiddenStems",
      +          "naYin",
      +          "naYinChinese",
      +          "naYinElement"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "summary": {
      +      "type": "string"
      +    },
      +    "zodiacAnimal": {
      +      "type": "string"
      +    },
      +    "zodiacAnimalLocalized": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "birthData",
      +    "conventions",
      +    "pillars",
      +    "dayMaster",
      +    "zodiacAnimal",
      +    "fiveElements",
      +    "interactions",
      +    "summary"
      +  ],
      +  "type": "object"
      +}
  5. Changed1 schema field changed
    • changedInput schema / properties / timezone / description
      Previous value: -"IANA 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."New value: +"IANA 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 offset in force at the birth date and time, historical daylight-saving rules included, while a fixed offset or decimal is taken literally and will be wrong if it does not match the daylight-saving state at that moment. On a transition day a time in the repeated hour is read as its first occurrence and a time in the skipped hour is moved forward past the gap. Invalid timezones return 400 with a validation error."
  6. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds genuinely behavioral context beyond that: the day boundary, year boundary and hour clock are selectable and 'the applied conventions come back on every response, so a chart is self-describing' — telling the agent the result is reproducible and convention-stamped, which matters for a computation whose answers vary by school. It stops short of noting latency, auth, or error behavior.

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?

Front-loaded with the verb and the output inventory, and the second sentence covers the configurability and reproducibility guarantee. The closing 'Built for astrology apps, matchmaking services...' is partly promotional framing, though it does signal the intended consumer, so it earns only partial credit.

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?

An output schema exists, and the description still summarizes the return payload well enough to set expectations. With 10 parameters (3 required), 4 enums and 100% schema coverage, everything an agent needs to call this correctly — required inputs, conventional variability, and error triggers for hourClock/longitude — is covered between description and schema.

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

Parameters3/5

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

Schema coverage is 100% and the parameter descriptions are unusually thorough (timezone resolution, dayBoundary schools, yearBoundary disagreement), so the schema carries the semantic load. The description only restates at a high level that the three boundary/clock conventions are selectable and echoed back; it adds no parameter detail beyond that. Baseline 3 is appropriate.

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 and resource ('Calculate a complete BaZi chart, the Four Pillars of Destiny, from a birth moment') and enumerates exactly what the chart contains (four pillars, hidden stems, Ten Gods, Na Yin, element balance, combinations and clashes). That enumeration makes it distinguishable from the derived siblings (luck pillars, annual forecast, compatibility, day master) without naming them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the scope ('from a birth moment', 'agents that need a Four Pillars reading they can reproduce'), so an agent can infer this is the base chart every other reading builds on. However, there is no explicit when-to-use versus when-not guidance and no sibling is named as an alternative, so routing must be inferred from the output list.

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