Skip to main content
Glama
spyfree

Mingli MCP Server

by spyfree

get_ziwei_chart

Read-onlyIdempotent

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)
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the agent knows this is a safe, repeatable read operation. The description adds no behavioral context beyond what annotations provide - no information about rate limits, authentication requirements, performance characteristics, or error conditions. However, it doesn't contradict the annotations, so it meets the minimum baseline with annotations present.

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 a single, efficient Chinese sentence that clearly states the tool's purpose and the scope of information returned. Every word earns its place - it specifies what information is obtained and lists the key components included. No wasted words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 12 parameters (3 required) and no output schema, the description is minimally adequate. The annotations cover safety aspects, and the schema has good documentation coverage. However, the description doesn't explain what format or structure the returned chart information will have, which would be helpful given the complexity of Ziwei charts and the absence of an output 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?

With 83% schema description coverage, the input schema already provides comprehensive documentation for most parameters. The description mentions '排盘信息' (chart arrangement information) which implies the parameters are for birth data input, but adds no specific guidance about parameter interactions, default behaviors, or special considerations beyond what's in the schema descriptions. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '获取紫微斗数排盘信息' (get Ziwei Dou Shu chart information). It specifies the resource (Ziwei chart) and the scope of information returned (twelve palaces, main stars, auxiliary stars, four transformations). However, it doesn't explicitly differentiate from sibling tools like 'get_ziwei_fortune' or 'analyze_ziwei_palace', which likely provide different aspects of Ziwei analysis.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools related to Ziwei and fortune analysis (get_ziwei_fortune, analyze_ziwei_palace, etc.), but the description doesn't indicate whether this is the primary chart generation tool versus more specialized analysis tools. No context about prerequisites or typical use cases is provided.

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

Install Server

Other Tools

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