generate_horoscope
Create a Tu Vi horoscope chart from birth details, returning structured data and an optional visual PNG image.
Instructions
Generate a full Tu Vi (Vietnamese horoscope) chart from raw birth details, with optional high-quality visual chart image rendering.
Purpose and Comparison
Use this tool when you want to compute and inspect an astrological birth chart from scratch for arbitrary birth details without retrieving from or saving to the database.
Contrast with
get_saved_horoscope: Usegenerate_horoscopefor new/unsaved calculations. Useget_saved_horoscopewhen you want to load a previously saved profile by ID or Name.Contrast with
save_horoscope: This tool does not persist details. Usesave_horoscopeto store details for future quick reference.
Side Effects, Auth, and Rate Limits
Side Effects: If
generate_imageisTrue, it renders a high-quality PNG chart layout and saves it to a temporary path on the local filesystem, returning the file path. It is read-only with respect to database/user records.Auth/Rate Limits: Runs entirely locally. No authentication or external rate limits apply.
Prerequisites
The date parameters must form a valid date in either the Solar or Lunar calendar.
Parameter Guidelines & Interactions
name: Name of the subject (default: "Khách").day: Day of birth (1-31).month: Month of birth (1-12).year: Year of birth (e.g., 1995).hour_val: Hour of birth. Accepts string formats like "14:30", "Ngọ" (Earthly Branch name), or numeric branch index (1-12, where 1=Tý, 12=Hợi) (default: "12:00").gender_val: Gender of the subject. Accepts "Nam", "Nữ", "male", "female" (case-insensitive, default: "Nam").is_solar: Set toTrue(default) if the birth date is Solar (Dương lịch). Set toFalseif it is Lunar (Âm lịch).current_year: Year to calculate transit stars/Vận Hạn for (default: system current year, e.g., 2026).generate_image: Set toTrue(default) to render and return a visual PNG chart along with raw data. Set toFalseto return only raw data.
Output Schema and Error Conditions
If
generate_imageisTrue: Returns a list[Image, chart_data]whereImageis a FastMCP Image object pointing to the generated PNG file on disk, andchart_datais a dictionary containing structured chart details (demographics, houses, stars).If
generate_imageisFalse: Returns only thechart_datadictionary.Structure of
chart_data:thien_ban: Dict containing calculated demographics, pillars/Can-Chi (year, month, day, hour), element (Hành Cục), destiny (Bản Mệnh), etc.dia_ban: List of 12 dicts, each representing an astrological house (cung), includingcung_so(1-12),cung_ten(name),cung_chu(domain),sao(list of stars), and optional transit/Hạn keys.
Errors: Returns an error dictionary
{"error": "error_message"}if calculations fail (e.g. invalid date formats, out-of-range birth years).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | No | ||
| name | No | Khách | |
| year | No | ||
| month | No | ||
| hour_val | No | 12:00 | |
| is_solar | No | ||
| gender_val | No | Nam | |
| current_year | No | ||
| generate_image | No |