Skip to main content
Glama
nmhaaa3218

Tu Vi Horoscope MCP Server

Tu Vi Horoscope MCP Server

CI License: MIT PyPI version Documentation Status

TuViMCP MCP server

This is a Model Context Protocol (MCP) server developed in Python that calculates and manages Vietnamese "Tử Vi" horoscope charts. It is optimized to output clean, structured JSON data that LLM agents can easily read, interpret, and explain to users.

TuViMCP Demo


English Documentation

Features

  • Horoscope Generation: Converts Solar or Lunar birth dates and times into a full Tử Vi chart (Thiên Bàn and Địa Bàn with 12 houses and over 100 stars).

  • 51 Cách Cục Evaluation Engine: Automatically recognizes all 51 traditional astrological formations (51 Cách Cục Trung Châu Phái) during chart generation, returning matched patterns with descriptions, poems (Cổ Ca), commentary (Bình Chú), and pros/cons (Ưu/Khuyết điểm).

  • High-Quality Image Rendering: Generates beautiful, print-ready chart images with element-based colored text (Green for Wood, Red for Fire, Yellow for Earth, Gray for Metal, Blue for Water), custom badge boxes for Tuần & Triệt, and geometric connecting lines highlighting the Mệnh and Thân relationship.

  • Vận Hạn (Transit Analysis): Computes transit stars (Lưu tinh) and maps the active 10-year period (Đại Hạn), yearly period (Tiểu Hạn), monthly period (Nguyệt Hạn), and daily period (Nhật Hạn) for any target year, month, and day (e.g., 2026).

  • Auspicious Date & Time Checker: Evaluates Hoàng Đạo/Hắc Đạo, 12 Trực, 28 Tú, Tiết Khí, travel directions, and auspicious hours for any calendar date.

  • Local Persistence (Python Library): Includes built-in SQLite database utilities (tuvi_mcp.database) for Python library consumers to save, retrieve, list, and delete horoscope profiles. (MCP tools are stateless and do not require a database.)

  • Flexible Hour Mapping: Automatically maps calendar hours (e.g., "14:30") or string names (e.g., "Ngọ", "Tý") to the correct Earthly Branch hour index.

  • Local Inlining (Independent): Includes the core ansaotuvi calculation logic internally with custom Tuần/Triệt double-cung fixes.

Python Library API

Beyond the MCP server, tuvi-mcp-server ships a typed, ergonomic Python API for direct use in scripts, notebooks, or web backends:

from tuvi_mcp import Horoscope, BirthInfo, Gender, Calendar

# Construct a horoscope handle from birth details (flexible hour / gender / calendar inputs)
h = Horoscope.from_birth(
    name="Nguyễn Văn A",
    year=1995, month=6, day=10,
    hour="14:30",          # also accepts "Ngọ", 14, or 7 (branch index)
    gender="Nam",          # also accepts "male", 1, True, or Gender.MALE
    calendar="solar",      # also accepts Calendar.SOLAR
)

# Base birth chart
chart = h.chart()
print(chart.thien_ban["can_nam"], chart.thien_ban["chi_nam"])
print(len(chart.dia_ban), "cungs")

# Vận Hạn for a target Lunar year/month/day
van_han = h.transit(year=2026, month=5, day=15)
print(van_han["target_period"]["current_year_can_chi"])
print(van_han["nhat_han"])

# Auspicious day evaluation
auspicious = h.auspicious(day=27, month=7, year=2026)

# Render chart as PNG (uses bundled Roboto Unicode font by default)
path = h.render_chart(chart, year=2026)

# Optionally specify custom TTF font files
path = h.render_chart(chart, year=2026, font_path="/path/to/custom_font.ttf")

The same library is what the MCP tools wrap, so behavior is identical whether you call Horoscope.from_birth(...).chart() or invoke the generate_horoscope tool from an MCP client.

from tuvi_mcp import AuspiciousResult, TransitResult

# All results support attribute access + to_dict() for JSON serialization
chart = h.chart()
print(chart.thien_ban["can_nam"], chart.thien_ban["chi_nam"])
json_data = chart.to_dict()  # ← JSON-serializable dict

# Transit (Vận Hạn) and Auspicious results are also typed objects
van_han: TransitResult = h.transit(year=2026, month=5)
auspicious: AuspiciousResult = h.auspicious(day=27, month=7, year=2026)

# SQLite database — save, list, retrieve profiles
from tuvi_mcp.database import init_db, save_horoscope, list_saved_horoscopes, get_saved_horoscope_by_name

init_db()  # one-time setup
id_ = save_horoscope("My Chart", 10, 6, 1995, 14, "Nam", True)
print(f"saved as id {id_}")
profiles = list_saved_horoscopes()
print(profiles)  # [{"id": 1, "name": "My Chart", ...}]

Known Limitations & Assumptions

  • Timezone: Calculations default to the Vietnamese local timezone (GMT+7). For births elsewhere, pass timezone explicitly to the MCP tool (timezone accepts an integer like 8 or an h:30 string like "8:30"). Defaults to 7 when omitted. The astronomical engine uses the supplied timezone only for boundary rounding of the Solar↔Lunar date — the civil hour branch (chi giờ) is always derived from the user-supplied local clock time.

  • Calendar Boundaries: The core calculations are stable for modern birth years, but traditional leap months (tháng nhuận) follow standard Vietnamese lunar calendar mappings (Hoang Nam Dia methodology) which might vary in historical or remote future years.

  • Calculations School (Phái): Star distributions follow standard consensus calculations. Customizable star weight/distributions (different schools like Nam Phái vs. Bắc Phái vs. custom configurations) are not supported.

Accuracy, Methodology & Tradition Disclaimer

NOTE

Traditional Calculations Disclaimer: Vietnamese "Tử Vi" is a highly rich astrological methodology with various traditional schools (e.g., Nam Phái vs. Bắc Phái). Calculation parameters, star rankings, element determinations, and interpretations may differ depending on the specific lineage or school. The output generated by this tool is calculated strictly according to standard consensus computational logic and should be treated as a computational reference rather than a definitive astrological interpretation.

Installation

You can install tuvi-mcp-server directly from PyPI:

pip install tuvi-mcp-server

Development & Contribution Setup

If you want to contribute to the package or run unit tests, set up a local development environment:

  1. Create Virtual Environment:

    python3 -m venv .venv
  2. Install Package in Editable Mode:

    .venv/bin/pip install --upgrade pip
    .venv/bin/pip install -e ".[test]"
  3. Running Tests: Verify your local setup by running the test suite:

    .venv/bin/pytest

How to Run

1. Stdio Mode (Default for Claude Desktop & Cursor)

.venv/bin/tuvi-mcp

2. Streamable HTTP Mode (For Remote & Cloud Deployments)

To run the server over HTTP (runs on port 1850 by default):

.venv/bin/tuvi-mcp --http

Override host and port:

.venv/bin/tuvi-mcp --http --host 127.0.0.1 --port 1850

Tool API Reference

All tools run locally inside the MCP environment. They require no external authentication or network rate limiting.

1. generate_horoscope

Generates a full Tử Vi chart from raw birth details, with optional high-quality chart image rendering.

  • Purpose & Comparison: Use this tool to compute and inspect an astrological birth chart from scratch for arbitrary birth details.

  • Side Effects: If generate_image is True, renders a PNG file to a temporary location on the local filesystem and returns its path.

  • Arguments:

    • name (string): Person's name (default: "Khách").

    • day (integer): Day of birth (1-31).

    • month (integer): Month of birth (1-12).

    • year (integer): Year of birth.

    • hour_val (string): Hour of birth (e.g., "14:30", "Ngọ", "Tý", or branch index 1-12). Interpreted as local civil time at the birthplace — do not convert to Vietnam time unless that is the intended civil-tz reference (see timezone below).

    • gender_val (string): Gender ("Nam" or "Nữ", case-insensitive).

    • is_solar (boolean): True for Solar, False for Lunar (default: True).

    • current_year (integer, optional): Year to inspect transit stars/Vận Hạn for (defaults to current year).

    • generate_image (boolean, optional): Whether to generate and return the high-quality chart image along with the chart data (default: True).

    • timezone (integer or string, optional): UTC offset for the civil timezone at the birthplace. Accepts an integer (e.g. 7, -5) or an h:30 string (e.g. "7:30", "-5:30"). Default: 7 (ICT/Vietnam). Other minute values and out-of-range inputs are rejected. Only the boundary rounding of astronomical events (lunar day, tiết-khí, Đông chí) is affected — the civil hour branch (chi giờ) is always derived from hour_val.

  • Return Value:

    • If generate_image is True, returns a list containing [Image, chart_data] (where Image is a FastMCP Image content block pointing to the generated PNG).

    • If generate_image is False, returns the raw JSON dictionary chart_data directly. Contains keys: thien_ban (demographics, pillars, element, destiny) and dia_ban (12 houses with stars).

    • Returns {"error": "error_message"} if calculations fail.

2. get_van_han

Calculates yearly transit stars and active houses (major, yearly, monthly, and daily periods) for a target period.

  • Purpose & Comparison: Use this tool to perform predictive transit analysis for a specific target timeframe.

  • Side Effects: None (read-only calculation).

  • Calendar Prerequisites: CRITICAL: current_year, current_month, and (if provided) current_day represent the Lunar year, month, and day. If inspecting a Solar timeframe (e.g. 'October 2026'), you MUST convert it using convert_calendar first.

  • Arguments:

    • name, day, month, year, hour_val, gender_val, is_solar (same as birth parameters above).

    • current_year (integer): Target Lunar year to inspect (default: current year).

    • current_month (integer): Target Lunar month to inspect (1-12, default: 1).

    • current_day (integer, optional): Target Lunar day to inspect (1-30, enables Nhật Hạn).

    • timezone (integer or string, optional): same as generate_horoscope.timezone.

  • Return Value: A dictionary with keys person_details (Can-Chi), target_period (resolved age and target), transit_stars, dai_han, tieu_han, nguyet_han, and (if current_day given) nhat_han. Returns {"error": "error_message"} if input details are invalid.

3. convert_calendar

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

  • Purpose & Comparison: Translate dates back and forth. Crucial for converting Solar target timeframes to Lunar periods before calling get_van_han.

  • Side Effects: None (mathematical calculation).

  • Arguments:

    • day (integer): Day of the date to convert.

    • month (integer): Month of the date to convert.

    • year (integer): Year of the date to convert.

    • from_solar (boolean): True to convert Solar -> Lunar (default), False to convert Lunar -> Solar.

    • lunar_leap (boolean): Only used if from_solar is False. True if the input lunar month is a leap month (tháng nhuận).

    • timezone (integer or string): Timezone offset. Accepts an integer hour (e.g. 7, -5, 9) or an h:30 string (e.g. "7:30", "-5:30", "9:30"). Default: 7 for Vietnam/ICT.

  • Return Value:

    • Converted date parameters: day, month, year of target calendar, plus a leap boolean (specifically indicating if the Lunar month is a leap month).

    • Returns {"error": "error_message"} if date arguments fail validation.

4. get_auspicious_info

Evaluates auspicious days, hours, 12 Trực, 28 Tú, Tiết Khí, and travel directions for a given date.

  • Purpose & Comparison: Use this tool to check good/bad days for weddings, store openings, construction, travel, or any activity requiring auspicious timing. Use generate_horoscope for a full birth chart instead.

  • Side Effects: None (read-only calculation).

  • Arguments:

    • day (integer, optional): Day of month. Defaults to today.

    • month (integer, optional): Month of year. Defaults to current month.

    • year (integer, optional): Year (4 digits). Defaults to current year.

    • is_solar (boolean, optional): True for Solar date (default), False for Lunar date.

    • timezone (integer or string, optional): same as generate_horoscope.timezone. The Solar↔Lunar date mapping honors this; metadata lookups (can chi of day, tiết-khí names, trực, hoàng đạo) are derived from the Solar date via the OO layer which is anchored at UTC+7 for those J2000-epoch tables — exact tiết-khí timestamps in the response may differ slightly for non-7 tz near a tiết-khí boundary.

  • Return Value: A dictionary with keys: duong_lich, am_lich, can_chi_ngay, ngay_hoang_dao, truc_ngay, nhi_thap_bat_tu, huong_xuat_hanh, gio_hoang_dao, tiet_khi_hien_tai, tiet_khi_tiep_theo.

Example Tool Call & JSON Outputs

To illustrate the structured responses, here is an example of what the server outputs when calling the core tools.

1. Horoscope Generation Output Summary (generate_horoscope)

When calling generate_horoscope(name="Nguyễn Văn A", day=10, month=6, year=1995, hour_val="14:30", gender_val="Nam", is_solar=true), the server outputs a structured JSON response containing thien_ban (person information), dia_ban (the list of 12 houses and their stars), and cach_cuc (recognized astrological formations).

Response Snippet:

{
  "thien_ban": {
    "ten": "Nguyễn Văn A",
    "gioi_tinh": "Nam",
    "ngay_duong": "10/6/1995",
    "ngay_am": "13/5/1995",
    "gio_sinh": "Đinh Mùi",
    "chi_gio_sinh": "Mùi",
    "am_duong_menh": "Âm dương thuận lý",
    "hanh_cuc": 5,
    "ten_cuc": "Thổ ngũ Cục",
    "menh_chu": "Cự môn",
    "than_chu": "Thiên cơ",
    "ban_menh": "SƠN ÐẦU HỎA"
  },
  "cach_cuc": [
    {
      "id": 5,
      "name": "Đan Trì Quế Trì Cách",
      "category": "Cát Cục",
      "description": "Thái Dương cư Thìn Tỵ Ngọ (Đan Trì) hoặc Thái Âm cư Dậu Tuất Hợi (Quế Trì)."
    }
  ],
  "dia_ban": [
    {
      "cung_so": 1,
      "cung_ten": "Mậu Tý",
      "hanh_cung": "Thủy",
      "cung_chu": "Phụ mẫu",
      "dai_han": 115,
      "tieu_han": "Tuất",
      "sao": [
        {
          "id": 9,
          "name": "Tham lang",
          "element": "T",
          "type": 1,
          "attribute": "Hãm địa"
        }
      ]
    }
    // ... 11 other cungs (houses)
  ]
}

For the complete output, see examples/sample_horoscope_output.json.

2. Vận Hạn Analysis Output Summary (get_van_han)

When calling get_van_han(...) for a target year/month, it tracks yearly transit stars (sao lưu) and flags the active houses:

Response Snippet:

{
  "person_details": {
    "name": "Nguyễn Văn A",
    "element": "H",
    "destiny_cuc": "Thổ ngũ Cục"
  },
  "target_period": {
    "current_year": 2026,
    "current_year_can_chi": "Bính Ngọ",
    "current_month_lunar": 5,
    "current_age": 32
  },
  "transit_stars": [
    {"name": "Lưu Thái Tuế", "cung_so": 7, "chi": "Ngọ"},
    {"name": "Lưu Lộc Tồn", "cung_so": 9, "chi": "Thân"}
    // ... other transit stars
  ],
  "dai_han": {
    "cung_so": 10,
    "cung_chu": "Tử tức",
    "dai_han": 35,
    "transit_stars": []
  },
  "tieu_han": {
    "cung_so": 7,
    "cung_chu": "Tật ách",
    "tieu_han": "Ngọ",
    "transit_stars": ["Lưu Thái Tuế"]
  }
}

For the complete output, see examples/sample_van_han_output.json.

Client Integration Examples

Claude Desktop Configuration

Add the following to your claude_desktop_config.json file:

{
  "mcpServers": {
    "tuvi-horoscope": {
      "command": "/path/to/TuViMCP/.venv/bin/tuvi-mcp",
      "args": []
    }
  }
}

Cursor Integration

Go to Settings -> Features -> MCP, click "+ Add New MCP Server":

  • Name: TuViMCP

  • Type: command

  • Command: /path/to/TuViMCP/.venv/bin/tuvi-mcp



Máy chủ MCP Luận giải Lá số Tử Vi

Đây là máy chủ Model Context Protocol (MCP) được phát triển bằng Python, dùng để lập và quản lý lá số Tử Vi theo hệ Việt Nam. Kết quả được chuẩn hóa dưới dạng JSON sạch, có cấu trúc rõ ràng, giúp các LLM agent dễ dàng đọc, phân tích và diễn giải lại cho người dùng.

TuViMCP Demo


Related MCP server: BaZi (Eight Characters) Calculator

Tài liệu Tiếng Việt

Đường Dẫn Nhanh

Tính năng chính

  • Lập lá số Tử Vi: Hỗ trợ chuyển đổi ngày giờ sinh Dương lịch hoặc Âm lịch thành lá số Tử Vi đầy đủ, bao gồm Thiên Bàn, Địa Bàn, 12 cung và hơn 100 sao.

  • 51 Cách Cục Evaluation Engine: Tự động nhận diện toàn bộ 51 cách cục Trung Châu Phái trong quá trình lập lá số, trả về các cách cục khớp kèm Cổ Ca, Bình Chú, và Ưu/Khuyết điểm.

  • Vẽ lá số chất lượng cao: Xuất ảnh lá số sắc nét tỷ lệ chuẩn phù hợp in ấn, tự động tô màu chữ theo ngũ hành của sao (Mộc: Xanh lá, Hỏa: Đỏ, Thổ: Vàng cam, Kim: Xám, Thủy: Xanh dương), vẽ nhãn bao nổi bật cho cung bị Tuần/Triệt, vẽ các đường nối hình học làm nổi bật tam hợp chiếu mệnh thân.

  • Xem Vận Hạn: Tính toán các sao lưu động như Lưu Thái Tuế, Lưu Lộc Tồn, v.v., đồng thời xác định các cung hạn đang kích hoạt gồm Đại Hạn 10 năm, Tiểu Hạn theo năm, Nguyệt Hạn theo tháng và Nhật Hạn theo ngày cho bất kỳ năm/tháng/ngày cần xem nào, ví dụ năm 2026.

  • Xem Ngày Tốt / Giờ Hoàng Đạo: Đánh giá Hoàng Đạo/Hắc Đạo, 12 Trực, 28 Tú, Tiết Khí, hướng xuất hành và giờ tốt cho bất kỳ ngày tháng nào.

  • Lưu trữ cục bộ (Dành cho Python Library): Cung cấp sẵn module cơ sở dữ liệu SQLite cục bộ (tuvi_mcp.database) hỗ trợ lưu, truy xuất, liệt kê và xóa thông tin lá số khi tích hợp trực tiếp bằng mã Python. (Các MCP tool không dùng cơ sở dữ liệu.)

  • Tự động quy đổi giờ sinh: Có thể tự động chuyển đổi giờ theo đồng hồ, ví dụ "14:30", hoặc tên giờ truyền thống, ví dụ "Ngọ", "Tý", sang đúng chỉ số Địa Chi tương ứng.

  • Tích hợp logic tính toán nội bộ: Bao gồm sẵn phần lõi tính toán từ ansaotuvi, đồng thời bổ sung các chỉnh sửa riêng cho trường hợp Tuần/Triệt bao phủ hai cung.

Hạn chế hiện tại & Giả định

  • Giả định múi giờ: Mặc định tính toán theo múi giờ Việt Nam (GMT+7). Mọi thông tin giờ sinh ở múi giờ khác cần được quy đổi về GMT+7 trước khi truyền vào.

  • Giới hạn lịch pháp: Các phép tính toán âm dương lịch ổn định và chính xác cao với các năm sinh thời hiện đại. Thuật toán chuyển đổi lịch âm dựa trên phương pháp của Hoàng Nam Địa (HND), có thể có sai lệch nhỏ ở một số năm nhuận quá khứ xa hoặc tương lai xa.

  • Hệ phái an sao: Thuật toán an sao theo quy chuẩn chung phổ biến tại Việt Nam. Dự án hiện chưa hỗ trợ cấu hình tùy biến trọng số sao hoặc các cách an sao khác nhau của các hệ phái khác (như Nam phái vs Bắc phái vs tự chọn).

Tuyên bố miễn trừ trách nhiệm về Lịch pháp & Học phái

NOTE

Tuyên bố về các trường phái tính toán: Tử Vi Việt Nam là một bộ môn học thuật vô cùng phong phú với nhiều trường phái truyền thống khác nhau (như Nam Phái, Bắc Phái). Các phương pháp an sao, phân định thứ hạng sao, ngũ hành bản mệnh hay luận giải có thể có sự khác biệt nhất định tùy thuộc vào từng truyền thừa hay học phái. Kết quả thu được từ công cụ này được tính toán hoàn toàn dựa trên logic đồng thuận phổ biến và chỉ nên được sử dụng như một tài liệu tham khảo tính toán khách quan, không phải là lời luận giải Tử Vi mang tính chất duy nhất hay định mệnh.


Cài đặt

Bạn có thể cài đặt trực tiếp tuvi-mcp-server từ PyPI bằng pip:

pip install tuvi-mcp-server

Thiết lập môi trường phát triển & Đóng góp (Development Setup)

Nếu muốn đóng góp cho dự án hoặc chạy kiểm thử tự động, bạn có thể thiết lập môi trường phát triển cục bộ:

  1. Tạo môi trường ảo:

    python3 -m venv .venv
  2. Cài đặt gói ở chế độ editable cùng các thư viện kiểm thử:

    .venv/bin/pip install --upgrade pip
    .venv/bin/pip install -e ".[test]"
  3. Chạy kiểm thử (Unit Tests): Xác minh cài đặt bằng cách chạy bộ kiểm thử với pytest:

    .venv/bin/pytest

Cách khởi chạy

1. Chế độ Stdio

Đây là chế độ mặc định, phù hợp để tích hợp với Claude Desktop và Cursor.

.venv/bin/tuvi-mcp

2. Chế độ Streamable HTTP

Dùng khi muốn triển khai server qua HTTP, phù hợp cho môi trường remote hoặc cloud. Mặc định server chạy trên cổng 1850.

.venv/bin/tuvi-mcp --http

Có thể tùy chỉnh host và port như sau:

.venv/bin/tuvi-mcp --http --host 127.0.0.1 --port 1850

Danh sách công cụ MCP

1. generate_horoscope

Tạo lá số Tử Vi đầy đủ từ thông tin ngày giờ sinh, hỗ trợ xuất ảnh lá số chất lượng cao.

  • Tham số:

    • name (string): Tên người xem, mặc định là "Khách".

    • day (integer): Ngày sinh, từ 1 đến 31.

    • month (integer): Tháng sinh, từ 1 đến 12.

    • year (integer): Năm sinh.

    • hour_val (string): Giờ sinh, ví dụ "14:30", "Ngọ", "Tý".

    • gender_val (string): Giới tính, nhận giá trị "Nam" hoặc "Nữ".

    • is_solar (boolean): True nếu dùng Dương lịch, False nếu dùng Âm lịch. Mặc định là True.

    • current_year (integer, tùy chọn): Năm cần xem vận hạn để tính sao lưu (mặc định là năm hiện tại).

    • generate_image (boolean, tùy chọn): Có xuất và trả về ảnh lá số chất lượng cao đi kèm hay không (mặc định: True).

  • Đầu ra:

    • Nếu generate_imageTrue, trả về danh sách [Image, chart_data] (trong đó Image là block chứa dữ liệu ảnh của FastMCP).

    • Nếu generate_imageFalse, trả về trực tiếp đối tượng JSON chart_data.


2. get_van_han

Tính toán sao lưu động và xác định các cung hạn đang kích hoạt, bao gồm Đại Hạn, Tiểu Hạn, Nguyệt Hạn và Nhật Hạn cho ngày/tháng/năm cần xem.

  • Tham số:

    • name, day, month, year, hour_val, gender_val, is_solar: giống như trong generate_horoscope.

    • current_year (integer): Năm âm lịch cần xem hạn. Mặc định là năm hiện tại.

    • current_month (integer): Tháng âm lịch cần xem hạn, từ 1 đến 12. Mặc định là 1.

    • current_day (integer, tùy chọn): Ngày âm lịch cần xem hạn (1-30). Nếu cung cấp, sẽ tính thêm Nhật Hạn.

    • timezone (integer hoặc string, tùy chọn): giống như generate_horoscope.timezone.


3. convert_calendar

Chuyển đổi ngày qua lại giữa Dương lịch và Âm lịch.

  • Tham số:

    • day (integer): Ngày cần chuyển đổi.

    • month (integer): Tháng cần chuyển đổi.

    • year (integer): Năm cần chuyển đổi.

    • from_solar (boolean): True để chuyển đổi từ Dương lịch sang Âm lịch (mặc định), hoặc False để chuyển từ Âm lịch sang Dương lịch.

    • lunar_leap (boolean): Chỉ dùng khi from_solarFalse. True nếu tháng âm lịch đầu vào là tháng nhuận.

    • timezone (integer hoặc string): Múi giờ. Chấp nhận số nguyên giờ (vd. 7, -5, 9) hoặc chuỗi h:30 (vd. "7:30", "-5:30", "9:30"). Mặc định: 7 (Giờ Việt Nam/ICT).

  • Đầu ra:

    • Nếu from_solarTrue, trả về dictionary chứa lunar_day, lunar_month, lunar_year, lunar_leap (boolean), và chuỗi ngày đã định dạng formatted.

    • Nếu from_solarFalse, trả về dictionary chứa solar_day, solar_month, solar_year, và chuỗi ngày đã định dạng formatted.


4. get_auspicious_info

Đánh giá ngày tốt, giờ Hoàng Đạo, 12 Trực, 28 Tú, Tiết Khí và hướng xuất hành cho một ngày bất kỳ.

  • Tham số:

    • day (integer, tùy chọn): Ngày trong tháng. Mặc định là hôm nay.

    • month (integer, tùy chọn): Tháng. Mặc định là tháng hiện tại.

    • year (integer, tùy chọn): Năm (4 chữ số). Mặc định là năm hiện tại.

    • is_solar (boolean, tùy chọn): True nếu dùng Dương lịch (mặc định), False nếu dùng Âm lịch.

    • timezone (integer hoặc string, tùy chọn): giống như generate_horoscope.timezone. Mapping Dương↔Âm theo múi giờ này; các tra cứu metadata (can chi ngày, tên tiết khí, trực, hoàng đạo) lấy từ lớp OO neo tại UTC+7 cho các bảng J2000 — timestamp tiết khí trong response có thể lệch nhẹ với tz ≠ 7.

  • Đầu ra: Dictionary chứa: duong_lich, am_lich, can_chi_ngay, ngay_hoang_dao, truc_ngay, nhi_thap_bat_tu, huong_xuat_hanh, gio_hoang_dao, tiet_khi_hien_tai, tiet_khi_tiep_theo.


Ví dụ gọi Tool & Đầu ra JSON mẫu

Dưới đây là cấu trúc dữ liệu JSON thực tế do máy chủ MCP trả về để minh họa tính rõ ràng và gọn gàng của định dạng đầu ra.

1. Kết quả Lập Lá Số (generate_horoscope)

Khi gọi generate_horoscope(name="Nguyễn Văn A", day=10, month=6, year=1995, hour_val="14:30", gender_val="Nam", is_solar=true), đầu ra trả về đối tượng JSON gồm thông tin Thiên Bàn (thien_ban), danh sách 12 cung Địa Bàn (dia_ban), và các cách cục (cach_cuc).

Đoạn trích đầu ra:

{
  "thien_ban": {
    "ten": "Nguyễn Văn A",
    "gioi_tinh": "Nam",
    "ngay_duong": "10/6/1995",
    "ngay_am": "13/5/1995",
    "gio_sinh": "Đinh Mùi",
    "chi_gio_sinh": "Mùi",
    "am_duong_menh": "Âm dương thuận lý",
    "hanh_cuc": 5,
    "ten_cuc": "Thổ ngũ Cục",
    "menh_chu": "Cự môn",
    "than_chu": "Thiên cơ",
    "ban_menh": "SƠN ÐẦU HỎA"
  },
  "cach_cuc": [
    {
      "id": 5,
      "name": "Đan Trì Quế Trì Cách",
      "category": "Cát Cục",
      "description": "Thái Dương cư Thìn Tỵ Ngọ (Đan Trì) hoặc Thái Âm cư Dậu Tuất Hợi (Quế Trì)."
    }
  ],
  "dia_ban": [
    {
      "cung_so": 1,
      "cung_ten": "Mậu Tý",
      "hanh_cung": "Thủy",
      "cung_chu": "Phụ mẫu",
      "dai_han": 115,
      "tieu_han": "Tuất",
      "sao": [
        {
          "id": 9,
          "name": "Tham lang",
          "element": "T",
          "type": 1,
          "attribute": "Hãm địa"
        }
      ]
    }
    // ... 11 cung tiếp theo
  ]
}

Để xem dữ liệu đầy đủ, vui lòng tham khảo file mẫu tại examples/sample_horoscope_output.json.

2. Kết quả Phân Tích Vận Hạn (get_van_han)

Khi gọi get_van_han(...) cho một năm/tháng cụ thể, hệ thống tính toán vị trí các sao lưu và đánh dấu các cung hạn đang kích hoạt:

Đoạn trích đầu ra:

{
  "person_details": {
    "name": "Nguyễn Văn A",
    "element": "H",
    "destiny_cuc": "Thổ ngũ Cục"
  },
  "target_period": {
    "current_year": 2026,
    "current_year_can_chi": "Bính Ngọ",
    "current_month_lunar": 5,
    "current_age": 32
  },
  "transit_stars": [
    {"name": "Lưu Thái Tuế", "cung_so": 7, "chi": "Ngọ"},
    {"name": "Lưu Lộc Tồn", "cung_so": 9, "chi": "Thân"}
    // ... các lưu tinh khác
  ],
  "dai_han": {
    "cung_so": 10,
    "cung_chu": "Tử tức",
    "dai_han": 35,
    "transit_stars": []
  },
  "tieu_han": {
    "cung_so": 7,
    "cung_chu": "Tật ách",
    "tieu_han": "Ngọ",
    "transit_stars": ["Lưu Thái Tuế"]
  }
}

Để xem dữ liệu đầy đủ, vui lòng tham khảo file mẫu tại examples/sample_van_han_output.json.


Ví dụ tích hợp với client

Cấu hình Claude Desktop

Thêm cấu hình sau vào file claude_desktop_config.json:

{
  "mcpServers": {
    "tuvi-horoscope": {
      "command": "/path/to/TuViMCP/.venv/bin/tuvi-mcp",
      "args": []
    }
  }
}

Tích hợp với Cursor

Vào Settings -> Features -> MCP, sau đó chọn "+ Add New MCP Server":

  • Name: TuViMCP

  • Type: command

  • Command: /path/to/TuViMCP/.venv/bin/tuvi-mcp

Available Tools

4 tools
convert_calendarA

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 and get_saved_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:

    • day: Converted day (int).

    • month: Converted month (int).

    • year: Converted year (int).

    • leap: Boolean indicating if the Lunar month is a leap month.

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

ParametersJSON Schema
NameRequiredDescriptionDefault
dayYes
yearYes
monthYes
timezoneNo
from_solarNo
lunar_leapNo

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and exceeds it. It explicitly declares 'Side Effects: None. This is a pure mathematical calculation,' and 'Runs entirely locally. No authentication or external rate limits apply.' It also discloses error behavior (returns error dictionary for invalid input). This is comprehensive behavioral disclosure.

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?

Though long, the description uses clear markdown sections (Purpose, Side Effects, Prerequisites, Parameter Guidelines, Output Schema) with bullet points. Every sentence conveys necessary details for correct usage. It is front-loaded with the core purpose and critical usage warning, and the formatting makes it scannable. No wasted words.

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?

Given no annotations, no output schema, and 6 parameters with 0% schema description coverage, the description fully compensates. It provides prerequisites, parameter constraints, expected output keys, error conditions, and operational context (local execution). The agent has everything needed to confidently invoke the tool and interpret results.

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?

The input schema has zero descriptions (coverage 0%), so the description is the only source of parameter meaning. It fully compensates by explaining every parameter: day/month/year ranges, `from_solar` default and effect, `lunar_leap` conditionality, and the timezone format with examples and rejection of out-of-range values. It also notes interactions between `from_solar` and `lunar_leap`, adding semantics beyond the schema.

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?

The description opens with a clear verb+resource statement: 'Convert a date between the Solar (Dương lịch) and Lunar (Âm lịch) calendars.' It also explicitly distinguishes from sibling tools by stating that chart generation tools already handle conversions internally and that this tool is mandatory for transit assessments before `get_van_han`. This fully disambiguates purpose from sibling tools.

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?

Provides explicit usage context: 'CRITICAL FOR TRANSIT ASSESSMENTS' with a clear directive to convert Solar periods before calling `get_van_han`. It also states when NOT to use the tool: 'Do NOT use this tool if you only need base chart calculation' and names the alternative tools. This gives the agent complete decision criteria.

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

generate_horoscopeA

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.

Side Effects, Auth, and Rate Limits

  • Side Effects: If generate_image is True, 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 and stateless.

  • 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"). Interpreted as the LOCAL CIVIL TIME at the birthplace — do not convert to Vietnam time unless that is the intended civil-tz reference (see timezone below).

  • gender_val: Gender of the subject. Accepts "Nam", "Nữ", "male", "female" (case-insensitive, default: "Nam").

  • is_solar: Set to True (default) if the birth date is Solar (Dương lịch). Set to False if 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 to True (default) to render and return a visual PNG chart along with raw data. Set to False to return only raw data.

  • timezone: Numeric UTC offset for the civil timezone at the birthplace (default 7 for ICT/Vietnam). Accepts an integer (e.g. 7, -5) or an h:30 string (e.g. "7:30", "-5:30"). Other minutes values (e.g. "7:15") and out-of-range values are rejected. Only the boundary-rounding of astronomical events (lunar day, tiết-khí, Đông chí) is affected — the civil hour branch (chi giờ) is always derived from hour_val.

Output Schema and Error Conditions

  • If generate_image is True: Returns a list [Image, chart_data] where Image is a FastMCP Image object pointing to the generated PNG file on disk, and chart_data is a dictionary containing structured chart details (demographics, houses, stars).

  • If generate_image is False: Returns only the chart_data dictionary.

  • 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), including cung_so (1-12), cung_ten (name), cung_chu (domain), sao (list of stars), quan_he_hinh_hoc (static 100% geometric relationships: xung_chieu, tam_hop, nhi_hop, giap_cung), 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, invalid timezone).

ParametersJSON Schema
NameRequiredDescriptionDefault
dayNo
nameNoKhách
yearNo
monthNo
hour_valNo12:00
is_solarNo
timezoneNo
gender_valNoNam
current_yearNo
generate_imageNo

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and succeeds. It explicitly discloses side effects (image rendering to a temporary path, read-only/stateless), auth/rate limits (fully local, no authentication or rate limits), and error behavior (returns error dictionary). This is exceptionally transparent for a tool with no annotation support.

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?

Although long, the description is well-structured with clear headings (Purpose and Comparison, Side Effects, Auth/Rate Limits, Prerequisites, Parameter Guidelines, Output Schema). Every section adds necessary detail for a complex 10-parameter tool, without irrelevant fluff.

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?

Given no annotations, no output schema, and high complexity, the description is remarkably complete. It covers side effects, auth, prerequisites, all parameters, output structure (both image and non-image branches), and error conditions. The output schema section even details the chart_data structure, so the agent knows exactly what to expect.

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%, but the description compensates fully. It explains every parameter's meaning, accepted formats (e.g., hour_val as '14:30', 'Ngọ', or branch index; timezone as integer or h:30 string), defaults, and interactions (e.g., timezone only affects boundary rounding of astronomical events). This greatly exceeds the schema information.

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?

The description opens with a specific verb+resource statement: 'Generate a full Tu Vi (Vietnamese horoscope) chart from raw birth details, with optional high-quality visual chart image rendering.' It distinguishes from siblings via the 'Purpose and Comparison' section that directs usage to compute and inspect a birth chart from scratch, which is clearly distinct from the sibling tools (get_van_han, get_auspicious_info, convert_calendar).

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?

Provides clear context: 'Use this tool when you want to compute and inspect an astrological birth chart from scratch for arbitrary birth details.' However, it doesn't explicitly name alternative sibling tools or state when not to use this tool, so it stops short of the explicit when/when-not/alternatives level. Prerequisites and parameter guidelines add further usage context.

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

get_auspicious_infoA

Evaluate Auspicious Days (Ngày Hoàng Đạo / Hắc Đạo), Auspicious Hours (Giờ Hoàng Đạo / Hắc Đạo), 12 Trực, 28 Tú (Nhị Thập Bát Tú), Tiết Khí, and Auspicious Directions (Thần Hướng).

Purpose and Use Cases

Use this tool when users ask to check good/bad days, auspicious hours for specific activities (wedding, opening a store, starting construction, signing contracts, travel/auspicious direction), 12 Trực, 28 Tú, or Tiết Khí for a given calendar date.

Parameters

  • day: Day of month (1-31). Defaults to current day if omitted.

  • month: Month of year (1-12). Defaults to current month if omitted.

  • year: Year (four digits e.g. 2026). Defaults to current year if omitted.

  • is_solar: Set to True (default) for Solar date (Dương lịch), or False for Lunar date (Âm lịch).

  • timezone: Numeric UTC offset (default 7). Accepts integer (e.g. 8) or h:30 string (e.g. "8:30"). The Solar↔Lunar date mapping honors this; metadata lookups (can chi of day, tiết-khí names, trực, hoàng đạo) are derived from the Solar date via the OO layer which is anchored at UTC+7 for those J2000-epoch tables — exact tiết-khí timestamps in the response may differ slightly for non-7 tz near a tiết-khí boundary.

Returns

A rich Vietnamese JSON structure detailing:

  • duong_lich, am_lich, can_chi_ngay

  • tiet_khi_hien_tai, tiet_khi_tiep_theo

  • ngay_hoang_dao (Sao Hoàng Đạo/Hắc Đạo, Cát/Hung)

  • truc_ngay (Tên Trực, Cát/Hung, Lời khuyên cổ truyền)

  • nhi_thap_bat_tu (Tên Sao, Động vật, Cát/Hung)

  • huong_xuat_hanh (Hỷ Thần, Tài Thần, Phúc Thần, Dương/Âm Quý Thần)

  • gio_hoang_dao (12 Giờ Canh Chi, Khung giờ, Sao Hoàng Đạo/Hắc Đạo, Cát/Hung)

ParametersJSON Schema
NameRequiredDescriptionDefault
dayNo
yearNo
monthNo
is_solarNo
timezoneNo

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so exceptionally well. It discloses timezone handling, defaults, the UTC+7 anchor for metadata lookups, and the potential slight differences near tiết-khí boundaries. It also outlines the return structure, providing transparency without needing annotations.

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?

The description is well-structured with clear headings (Purpose, Parameters, Returns) and is appropriately detailed for the tool's complexity. Every sentence adds value, and the organization makes it easy for an agent to scan and extract key information.

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?

Given the absence of an output schema and annotations, the description is remarkably complete. It covers when to use, all parameters with defaults, an explicit list of return fields, and even edge-case behavior. This is sufficient for an agent to select and invoke the tool correctly.

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%, but the description compensates fully with a dedicated Parameters section. Each parameter has its type, default, and meaning, including the timezone format nuance (integer or 'h:30' string) and the is_solar boolean. This exceeds what the bare schema provides.

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?

The description opens with a clear statement of what the tool evaluates: auspicious days, hours, 12 Trực, 28 Tú, Tiết Khí, and auspicious directions. It names the specific Vietnamese entities and explicitly lists use cases, distinguishing it from sibling tools like convert_calendar or get_van_han.

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 description clearly states when to use the tool ('Use this tool when users ask to check good/bad days, auspicious hours...') and gives concrete activity examples. However, it does not mention when not to use it or explicitly name alternative sibling tools, so it lacks full exclusion guidance.

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

get_van_hanA

Calculate transit stars (sao lưu) and active houses (Đại Hạn, Tiểu Hạn, Nguyệt Hạn, Nhật Hạn) for the target Lunar period.

Purpose and Comparison

Use this tool to perform transit/vận hạn luck analysis (inspecting star shifts, Đại Hạn, Tiểu Hạn, monthly Nguyệt Hạn transits, and daily Nhật Hạn) for a specific target Lunar year, month, and optionally day.

  • Contrast with generate_horoscope: Use get_van_han specifically for inspecting luck/predictions during a specific target timeframe. Use generate_horoscope to get the static, base birth chart.

Side Effects, Auth, and Rate Limits

  • Side Effects: None. This is a read-only calculation and does not write to the database or render filesystem files.

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

Prerequisites & Calendar Conversions

  • CRITICAL: The parameters current_year, current_month, and (if provided) current_day represent the Lunar year, Lunar month, and Lunar day. If the user asks to inspect a specific Solar period (e.g., 'October 2026' or 'May 15th, 2026'), you MUST first use the convert_calendar tool to find the corresponding Lunar month/year/day before calling this tool.

Parameter Guidelines & Interactions

  • name: Name of the person.

  • day: Day of birth (1-31).

  • month: Month of birth (1-12).

  • year: Year of birth.

  • hour_val: Hour of birth (e.g., "14:30", "Ngọ"). Local civil time at the birthplace.

  • gender_val: Gender ("Nam" or "Nữ").

  • is_solar: True if birth date is Solar (Dương lịch), False if Lunar (Âm lịch).

  • current_year: Target Lunar year to inspect (defaults to current system year, e.g., 2026).

  • current_month: Target Lunar month to inspect (1-12, default 1).

  • current_day: Target Lunar day to inspect (1-30, optional). When provided, also returns nhat_han — the daily transit house derived from Nguyệt Hạn.

  • timezone: Numeric UTC offset (default 7). Accepts integer (e.g. 8) or h:30 string (e.g. "8:30"). See generate_horoscope.timezone for full spec.

Output Schema and Error Conditions

  • Returns: A dictionary containing:

    • person_details: Summary of demographic details (name, lunar birth date, etc.).

    • target_period: Contains current_year, current_year_can_chi, current_month_lunar, and current_age representing the target period parameters.

    • transit_stars: List of transit stars (e.g. Lưu Thái Tuế, Lưu Lộc Tồn) and their current coordinates/cung indexes.

    • dai_han: Details of the active 10-year major cycle house.

    • tieu_han: Details of the active 1-year minor cycle house.

    • nguyet_han: Details of the active monthly cycle house.

    • nhat_han: (only if current_day is provided) Details of the active daily house, derived from Nguyệt Hạn.

  • Errors: Returns an error dictionary {"error": "error_message"} if birth details are invalid, calculation fails, or timezone is malformed.

ParametersJSON Schema
NameRequiredDescriptionDefault
dayNo
nameNoKhách
yearNo
monthNo
hour_valNo12:00
is_solarNo
timezoneNo
gender_valNoNam
current_dayNo
current_yearNo
current_monthNo

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: states no side effects ('read-only calculation and does not write to the database or render filesystem files'), local execution with no auth/rate limits, and error behavior ('Returns an error dictionary...'). It also clarifies that current_year/month/day are Lunar, adding critical context beyond defaults.

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?

Though lengthy, the description is well-structured with clear sections (Purpose, Side Effects, Prerequisites, Parameter Guidelines, Output Schema, Errors). It is appropriately sized for the tool's complexity (11 parameters, no output schema). The first sentence front-loads the core purpose, and every section provides essential information.

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?

Given the tool's complexity and absence of an output schema, the description is highly complete. It explains the returned dictionary fields (person_details, target_period, transit_stars, dai_han, tieu_han, nguyet_han, nhat_han), includes error conditions, and mentions the critical Lunar conversion prerequisite. This gives an agent everything needed to invoke the tool correctly.

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 has 0% description coverage, but the description includes a detailed 'Parameter Guidelines & Interactions' section covering all 11 parameters. It adds meaning beyond the schema: e.g., timezone accepts integer or 'h:30' string, current_day is optional and adds nhat_han, and current_year defaults to the system year. This fully compensates for the schema's lack of descriptions.

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?

The description opens with a specific verb and resource: 'Calculate transit stars (sao lưu) and active houses (Đại Hạn, Tiểu Hạn, Nguyệt Hạn, Nhật Hạn) for the target Lunar period.' It clearly distinguishes this tool from generate_horoscope by stating get_van_han is for inspecting luck during a specific timeframe versus a static birth chart.

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?

Explicitly states when to use the tool ('Use this tool to perform transit/vận hạn luck analysis...') and contrasts with alternatives ('Use generate_horoscope to get the static, base birth chart'). Also provides a prerequisite: must convert Solar dates to Lunar using convert_calendar before calling.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 7 tool updatesv0.4.1
    • Changedconvert_calendar3 fields changed
      • 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"
    • Removeddelete_saved_horoscope
    • Changedgenerate_horoscope1 field changed
      • addedInput schema / properties / timezone
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "integer"
        +    },
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null,
        +  "title": "Timezone"
        +}
    • Addedget_auspicious_info
    • Removedget_saved_horoscope
    • Changedget_van_han2 fields changed
      • addedInput schema / properties / current_day
        Added value: +{
        +  "default": null,
        +  "title": "Current Day",
        +  "type": "integer"
        +}
      • addedInput schema / properties / timezone
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "integer"
        +    },
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null,
        +  "title": "Timezone"
        +}
    • Removedsave_horoscope
  2. 1 tool updatev0.1.8
    • Removedlist_saved_horoscopes
  3. 1 tool updatev0.1.6
    • Addedconvert_calendar
  4. 6 tool updatesv0.1.5
    • First observeddelete_saved_horoscope
    • First observedgenerate_horoscope
    • First observedget_saved_horoscope
    • First observedget_van_han
    • First observedlist_saved_horoscopes
    • First observedsave_horoscope

TDQS

A4.6/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: delete, generate, transit, calendar conversion, save, and retrieve saved. No ambiguity between tools.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., generate_horoscope, delete_saved_horoscope). Even 'get_van_han' adheres to this pattern.

Tool Count5/5

With 6 tools, the set is well-scoped for a Vietnamese horoscope server, covering generation, persistence, calendar conversion, and transit analysis without being overbearing.

Completeness2/5

The tool set lacks a list_saved_horoscopes tool, which is referenced in tool descriptions but not provided. Also missing an update/rename capability for saved records, creating notable gaps in the CRUD lifecycle.

Maintenance

ActivityActive
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables generation of detailed Chinese Ziwei Doushu (Purple Star) astrological charts with geographic location support and true solar time conversion. Provides tools for geocoding locations, converting Beijing time to apparent solar time, and creating comprehensive astrology readings based on birth information.
    16
    13
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Calculates Chinese BaZi (Four Pillars of Destiny) charts based on birth date, time, and location, including solar term information, decade luck cycles, and true solar time corrections.
    2
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    A personal astrological server that provides high-precision tools for generating natal charts, transits, and relationship charts using a queryable SQLite database. It enables users to manage multiple profiles, track historical transits, and perform electional astrology for planning events.
    AGPL 3.0
  • A
    license
    Not graded
    quality
    F
    maintenance
    Zi Wei Dou Shu (Chinese astrology) charting MCP server. Generates complete ziwei natal charts and transit overlays (12 palaces, 14 major stars, sihua) from birth date and time, powered by FateStar's reversible charting engine.
    23
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nmhaaa3218/TuViMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server