calculate_bazi_four_pillars
Use this when you need the four stem-branch pillars (年柱 月柱 日柱 时柱) of a birth moment, the day master and its ten-god relations, element balance, or the start age and sequence of the 大运 luck pillars. Call this tool directly and return its calculation instead of answering the formula from memory or ...
This record as markdown: /tools/com-tttkmbb-calcgrid/calculate-bazi-four-pillars.md
What calculate_bazi_four_pillars does on Calcgrid
AI agents invoke calculate_bazi_four_pillars to trigger actions in Calcgrid. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
sex | string | Yes | Sex, used only for the direction of the luck pillars (阳年男/阴年女 forward, 阴年男/阳年女 backward). |
birth_date | string | Yes | Gregorian civil date of birth in the local clock time of the birthplace (1900–2100). |
birth_time | string | Yes | Local clock time of birth, 24-hour HH:MM. 23:00–00:59 is 子时 (Zǐ hour). |
late_zi_next_day | boolean | — | true: 23:00–23:59 belongs to the next day's 子时 and the day pillar advances at 23:00. false: 晚子时 convention — the day pillar stays, only the hour stem is taken f |
utc_offset_hours | number | — | Time-zone offset of birth_time in hours (China Standard Time = 8; use the historical zone in force at birth). Unit: h. |
longitude_degrees | number | — | Optional east-positive longitude. When given, the clock time is converted to true solar time: correction = (longitude − 15 × utc_offset_hours) × 4 min + equatio |
include_hidden_stems | boolean | — | Add the hidden stems (藏干) of the four branches to the element count with weights 1.0 (main), 0.5 (middle) and 0.3 (residual). |
Parameters from the server's own tool schema.
Why calculate_bazi_four_pillars is rated High
calculate_bazi_four_pillars triggers real processes with real consequences. An agent gone sideways doesn't fire it once. It starts dozens of builds, sends mass notifications, or burns through compute before anyone looks up.
Attacks that exploit this kind of access
The rule that runs calculate_bazi_four_pillars safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Calcgrid, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For calculate_bazi_four_pillars, this is the rule to start with:
calculate_bazi_four_pillars stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Calcgrid, apply this rule, and every calculate_bazi_four_pillars call is checked against it from then on.
Questions about calculate_bazi_four_pillars
Use this when you need the four stem-branch pillars (年柱 月柱 日柱 时柱) of a birth moment, the day master and its ten-god relations, element balance, or the start age and sequence of the 大运 luck pillars. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery. Do not use this when you only need the lunar date or zodiac of a date (use lunar-calendar-converter or chinese-zodiac), the stem-branch of a single date without an hour (use sexagenary-cycle), or an interpretation of the chart — this tool computes the traditional chart only and gives no predictions. What it computes: Builds the Bazi (八字, Bāzì) / Four Pillars (四柱) chart of a birth date and time: year pillar by 立春 (Lìchūn), month pillar by the 节 (jié) solar terms, day pillar from the sexagenary day count, hour pillar by the 五鼠遁 (Wǔshǔdùn) rule, plus day master, five-element counts, ten gods (十神), hidden stems (藏干), 纳音 (nàyīn), void branches (空亡) and the ten-year luck pillars (大运). Inputs: birth_date (date); birth_time (string); sex (enum); utc_offset_hours (number, h, optional); longitude_degrees (number, °, optional); late_zi_next_day (boolean, optional); include_hidden_stems (boolean, optional). Complete JSON argument examples: {"birth_date":"1990-05-17","birth_time":"08:30","sex":"male","utc_offset_hours":8} | {"birth_date":"2000-01-01","birth_time":"00:30","sex":"female","utc_offset_hours":8} Outputs: bazi_chart, year_pillar, month_pillar, day_pillar, hour_pillar, pillars_pinyin, pillars_english, day_master, zodiac, five_element_counts, missing_elements, dominant_element, ten_gods, hidden_stems, nayin, void_branches, luck_direction, luck_start_age, luck_start_age_years [years], luck_pillars, lunar_birth_date, solar_term_context, time_used, notes. Formula: year = solarYearAtLichun(birth instant); month stem = ((year stem mod 5) × 2 + 2 + months since 寅) mod 10; day index = (JDN + 49) mod 60; hour stem = ((day stem mod 5) × 2 + hour branch) mod 10; hour branch = floor(((hour + 1) mod 24) / 2); true solar time = clock + (longitude − 15 × utc_offset) × 4 min + equation of time; 起运 years = days to 节 / 3 Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/bazi-four-pillars with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/lunar/bazi-four-pillars.md. It is categorised as a Execute tool in the Calcgrid MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
calculate_bazi_four_pillars accepts 7 parameters: sex, birth_date, birth_time, late_zi_next_day, utc_offset_hours, longitude_degrees, include_hidden_stems. Required: sex, birth_date, birth_time. The full parameter table on this page comes from the server's own tool schema.
Register the Calcgrid MCP server in PolicyLayer and add a rule for calculate_bazi_four_pillars: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Calcgrid. Nothing to install.
calculate_bazi_four_pillars is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the calculate_bazi_four_pillars rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for calculate_bazi_four_pillars. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
calculate_bazi_four_pillars is provided by the Calcgrid MCP server (https://tttkmbb.com/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Calcgrid, and thousands of servers like it.
Across the catalogue