Skip to main content
Glama
spyfree

Mingli MCP Server

by spyfree

get_ziwei_chart

Generate a Ziwei Doushu (Purple Star Astrology) chart using birth details to analyze destiny through twelve palaces, main stars, auxiliary stars, and transformations.

Instructions

获取紫微斗数排盘信息,包含命盘十二宫、主星、辅星、四化等详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes出生日期,格式:YYYY-MM-DD,例如:2000-08-16
time_indexYes出生时辰序号(0-12)
genderYes性别:男 或 女
calendarNo历法类型:solar(阳历) 或 lunar(农历)solar
is_leap_monthNo是否为闰月(仅当calendar=lunar时有效)
formatNomarkdown
languageNozh-CN
longitudeNo出生地经度,用于真太阳时修正
latitudeNo出生地纬度
use_solar_timeNo是否启用真太阳时修正
birth_hourNo精确出生小时(0-23)
birth_minuteNo精确出生分钟(0-59)

Implementation Reference

  • The handler function that implements the core logic for the get_ziwei_chart tool: validates input parameters, builds birth info, retrieves the Ziwei chart from the system, and formats the output.
    @log_performance
    def handle_get_ziwei_chart(args: Dict[str, Any]) -> str:
        """工具:获取紫微斗数排盘"""
        # Validate parameters
        _validate_common_params(
            args, ["date", "time_index", "gender"], ZIWEI_CHART_PARAM_DESCRIPTIONS, date_key="date"
        )
    
        with PerformanceTimer("紫微排盘"):
            birth_info = _build_birth_info(args)
            language = args.get("language", "zh-CN")
    
            system = get_system("ziwei")
            chart = system.get_chart(birth_info, language)
    
            output_format = args.get("format", "markdown")
            if output_format == "json":
                return _format_response(chart, "json")
            else:
                return _ziwei_formatter.format_chart_markdown(chart)
  • The schema definition for the get_ziwei_chart tool, specifying input parameters, types, descriptions, and requirements.
    def get_ziwei_chart_definition() -> Dict[str, Any]:
        """Get definition for get_ziwei_chart tool"""
        return {
            "name": "get_ziwei_chart",
            "description": "获取紫微斗数排盘信息,包含命盘十二宫、主星、辅星、四化等详细信息",
            "annotations": {
                "readOnlyHint": True,
                "destructiveHint": False,
                "idempotentHint": True,
            },
            "inputSchema": {
                "type": "object",
                "properties": {
                    "date": {
                        "type": "string",
                        "description": "出生日期,格式:YYYY-MM-DD,例如:2000-08-16",
                    },
                    "time_index": {
                        "type": "integer",
                        "description": "出生时辰序号(0-12)",
                        "minimum": 0,
                        "maximum": 12,
                    },
                    "gender": {
                        "type": "string",
                        "enum": ["男", "女"],
                        "description": "性别:男 或 女",
                    },
                    "calendar": {
                        "type": "string",
                        "enum": ["solar", "lunar"],
                        "default": "solar",
                        "description": "历法类型:solar(阳历) 或 lunar(农历)",
                    },
                    "is_leap_month": {
                        "type": "boolean",
                        "default": False,
                        "description": "是否为闰月(仅当calendar=lunar时有效)",
                    },
                    "format": {
                        "type": "string",
                        "enum": ["json", "markdown"],
                        "default": "markdown",
                    },
                    "language": {
                        "type": "string",
                        "enum": ["zh-CN", "zh-TW", "en-US", "ja-JP", "ko-KR", "vi-VN"],
                        "default": "zh-CN",
                    },
                    "longitude": {
                        "type": "number",
                        "description": "出生地经度,用于真太阳时修正",
                        "minimum": -180,
                        "maximum": 180,
                    },
                    "latitude": {
                        "type": "number",
                        "description": "出生地纬度",
                        "minimum": -90,
                        "maximum": 90,
                    },
                    "use_solar_time": {
                        "type": "boolean",
                        "default": False,
                        "description": "是否启用真太阳时修正",
                    },
                    "birth_hour": {
                        "type": "integer",
                        "description": "精确出生小时(0-23)",
                        "minimum": 0,
                        "maximum": 23,
                    },
                    "birth_minute": {
                        "type": "integer",
                        "description": "精确出生分钟(0-59)",
                        "minimum": 0,
                        "maximum": 59,
                    },
                },
                "required": ["date", "time_index", "gender"],
            },
        }
  • The registration of the get_ziwei_chart handler in the ToolRegistry during initialization.
    # Ziwei tools
    self.register("get_ziwei_chart", handle_get_ziwei_chart)

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/spyfree/mingli-mcp'

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