Skip to main content
Glama
spyfree

Mingli MCP Server

by spyfree

analyze_ziwei_palace

Read-onlyIdempotent

Analyze specific palace positions in Ziwei Doushu astrology to interpret life aspects like career, relationships, and health based on birth details and palace selection.

Instructions

分析紫微斗数特定宫位的详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
birth_dateYes出生日期,格式:YYYY-MM-DD
time_indexYes出生时辰序号(0-12)
genderYes
palace_nameYes要分析的宫位名称
calendarNosolar
is_leap_monthNo
formatNomarkdown
languageNozh-CN

Implementation Reference

  • The main handler function for the 'analyze_ziwei_palace' tool. It validates input parameters, builds birth info, retrieves the Ziwei system, calls analyze_palace method, and formats the output as markdown or JSON.
    @log_performance
    def handle_analyze_ziwei_palace(args: Dict[str, Any]) -> str:
        """工具:分析紫微斗数宫位"""
        # Validate parameters
        _validate_common_params(
            args,
            ["birth_date", "time_index", "gender", "palace_name"],
            ZIWEI_PALACE_PARAM_DESCRIPTIONS,
            date_key="birth_date",
        )
    
        with PerformanceTimer("紫微宫位分析"):
            birth_info = _build_birth_info(args, date_key="birth_date")
            palace_name = args["palace_name"]
            language = args.get("language", "zh-CN")
    
            system = get_system("ziwei")
            analysis = system.analyze_palace(birth_info, palace_name, language)
    
            output_format = args.get("format", "markdown")
            if output_format == "json":
                return _format_response(analysis, "json")
            else:
                return _ziwei_formatter.format_palace_analysis_markdown(analysis)
  • Defines the input schema and metadata for the 'analyze_ziwei_palace' tool, including parameters like birth_date, time_index, gender, palace_name, and output options.
    def get_analyze_ziwei_palace_definition() -> Dict[str, Any]:
        """Get definition for analyze_ziwei_palace tool"""
        return {
            "name": "analyze_ziwei_palace",
            "description": "分析紫微斗数特定宫位的详细信息",
            "annotations": {
                "readOnlyHint": True,
                "destructiveHint": False,
                "idempotentHint": True,
            },
            "inputSchema": {
                "type": "object",
                "properties": {
                    "birth_date": {
                        "type": "string",
                        "description": "出生日期,格式:YYYY-MM-DD",
                    },
                    "time_index": {
                        "type": "integer",
                        "description": "出生时辰序号(0-12)",
                        "minimum": 0,
                        "maximum": 12,
                    },
                    "gender": {
                        "type": "string",
                        "enum": ["男", "女"],
                    },
                    "palace_name": {
                        "type": "string",
                        "enum": [
                            "命宫",
                            "兄弟宫",
                            "夫妻宫",
                            "子女宫",
                            "财帛宫",
                            "疾厄宫",
                            "迁移宫",
                            "交友宫",
                            "官禄宫",
                            "田宅宫",
                            "福德宫",
                            "父母宫",
                        ],
                        "description": "要分析的宫位名称",
                    },
                    "calendar": {
                        "type": "string",
                        "enum": ["solar", "lunar"],
                        "default": "solar",
                    },
                    "is_leap_month": {
                        "type": "boolean",
                        "default": False,
                    },
                    "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",
                    },
                },
                "required": ["birth_date", "time_index", "gender", "palace_name"],
            },
        }
  • Registers the 'analyze_ziwei_palace' tool handler in the ToolRegistry during initialization.
    self.register("analyze_ziwei_palace", handle_analyze_ziwei_palace)
Behavior3/5

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

Annotations already declare this as read-only, idempotent, and non-destructive, so the agent knows it's a safe, repeatable query operation. The description adds value by specifying it provides '详细信息' (detailed information) about specific palaces, which gives context about the depth of analysis. However, it doesn't mention rate limits, authentication needs, or what constitutes 'detailed information' in practice.

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 immediately conveys the core purpose. There's zero wasted language or unnecessary elaboration. It's appropriately sized for what it communicates, though what it communicates is limited in scope.

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

Completeness2/5

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

For an 8-parameter tool with low schema coverage (38%) and no output schema, the description is inadequate. It doesn't explain what 'detailed information' means in the output, doesn't clarify the relationship between parameters, and provides no context about the Ziwei astrology system for users unfamiliar with it. The annotations help with safety profile, but the description leaves too many gaps for effective tool selection and use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 38% schema description coverage (3 of 8 parameters have descriptions), the description carries significant burden but adds no parameter information. It mentions analyzing '特定宫位' (specific palaces), which aligns with the 'palace_name' parameter, but doesn't explain the meaning or significance of parameters like 'time_index', 'calendar', 'is_leap_month', or the various format/language options. The description fails to compensate for the low 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 action ('分析' - analyze) and resource ('紫微斗数特定宫位' - specific Ziwei palace), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'get_ziwei_chart' or 'get_ziwei_fortune', which likely provide different types 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. With sibling tools like 'get_ziwei_chart' and 'get_ziwei_fortune' available, there's no indication whether this tool provides more detailed palace-specific analysis versus broader chart or fortune analysis. No context about prerequisites or typical use cases is mentioned.

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