Skip to main content
Glama
spyfree

Mingli MCP Server

by spyfree

get_bazi_chart

Read-onlyIdempotent

Generate a Bazi (Four Pillars) chart for Chinese fortune-telling analysis by inputting birth date, time, gender, and calendar type to receive detailed pillar, element, and deity information.

Instructions

获取八字(四柱)排盘信息,包含年月日时四柱、十神、五行、地支藏干等详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes出生日期,格式:YYYY-MM-DD
time_indexYes出生时辰序号(0-12)
genderYes
calendarNosolar
is_leap_monthNo
formatNomarkdown
languageNozh-CN

Implementation Reference

  • The main handler function that implements the core logic for the get_bazi_chart tool. It validates input parameters, builds birth information, retrieves the Bazi chart from the system, and formats the output.
    @log_performance
    def handle_get_bazi_chart(args: Dict[str, Any]) -> str:
        """工具:获取八字排盘"""
        # Validate parameters
        _validate_common_params(
            args, ["date", "time_index", "gender"], BAZI_CHART_PARAM_DESCRIPTIONS, date_key="date"
        )
    
        with PerformanceTimer("八字排盘"):
            birth_info = _build_birth_info(args)
            language = args.get("language", "zh-CN")
    
            system = get_system("bazi")
            chart = system.get_chart(birth_info, language)
    
            output_format = args.get("format", "markdown")
            if output_format == "json":
                return _format_response(chart, "json")
            else:
                return _bazi_formatter.format_chart(chart, "markdown")
  • The input schema and tool definition for get_bazi_chart, specifying parameters, types, descriptions, and required fields.
    def get_bazi_chart_definition() -> Dict[str, Any]:
        """Get definition for get_bazi_chart tool"""
        return {
            "name": "get_bazi_chart",
            "description": "获取八字(四柱)排盘信息,包含年月日时四柱、十神、五行、地支藏干等详细信息",
            "annotations": {
                "readOnlyHint": True,
                "destructiveHint": False,
                "idempotentHint": True,
            },
            "inputSchema": {
                "type": "object",
                "properties": {
                    "date": {
                        "type": "string",
                        "description": "出生日期,格式:YYYY-MM-DD",
                    },
                    "time_index": {
                        "type": "integer",
                        "description": "出生时辰序号(0-12)",
                        "minimum": 0,
                        "maximum": 12,
                    },
                    "gender": {
                        "type": "string",
                        "enum": ["男", "女"],
                    },
                    "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": ["date", "time_index", "gender"],
            },
        }
  • Registration of the get_bazi_chart handler (and related Bazi tools) in the ToolRegistry during initialization.
    # Bazi tools
    self.register("get_bazi_chart", handle_get_bazi_chart)
    self.register("get_bazi_fortune", handle_get_bazi_fortune)
    self.register("analyze_bazi_element", handle_analyze_bazi_element)
  • Inclusion of the get_bazi_chart schema definition in the list of all tool definitions.
    get_bazi_chart_definition(),
  • Loading of all tool definitions, including get_bazi_chart, into the registry.
    # Load definitions
    self._definitions = get_all_tool_definitions()
Behavior3/5

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

Annotations already indicate read-only, idempotent, and non-destructive behavior. The description adds minimal behavioral context beyond this—it implies data retrieval but doesn't disclose rate limits, authentication needs, or output format details. However, it doesn't contradict annotations, so it meets the lower bar 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose and lists included components. It avoids redundancy but could be slightly more structured by separating purpose from details. Every word earns its place, making it appropriately concise.

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 a tool with 7 parameters (4 with enums), low schema coverage (29%), and no output schema, the description is insufficient. It doesn't explain parameter meanings, output format, or behavioral nuances, leaving significant gaps in understanding how to use the tool effectively beyond its basic purpose.

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?

Schema description coverage is low (29%), with only 2 of 7 parameters described in the schema. The description doesn't compensate by explaining any parameters—it mentions no parameter details, leaving most semantics undocumented. This is inadequate given the low schema coverage and multiple parameters with enums.

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 clearly states the tool's purpose: '获取八字(四柱)排盘信息' (get Bazi chart information) and specifies the detailed components included: '年月日时四柱、十神、五行、地支藏干等详细信息' (four pillars, ten gods, five elements, hidden stems, etc.). It distinguishes itself from siblings like analyze_bazi_element or get_bazi_fortune by focusing on comprehensive chart generation rather than analysis or fortune-telling.

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. It doesn't mention sibling tools like analyze_bazi_element (for elemental analysis) or get_bazi_fortune (for fortune predictions), nor does it specify prerequisites or contextual constraints beyond what's implied by the parameters.

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