Skip to main content
Glama
Espivc

ming-metaphysics-mcp

by Espivc

ming_zwds_chart

Compute a Zi Wei Dou Shu natal chart to reveal palace highlights, starred positions, and transformations. Focus analysis on a specific life area or get a full twelve-palace overview.

Instructions

Compute a Zi Wei Dou Shu (紫微斗數) twelve-palace natal chart. Returns palace highlights, starred positions, 四化 transformations, and synthesis for a specific question domain. Verified against 紫微斗數全書.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
birth_dateYesDate of birth in YYYY-MM-DD format.
birth_hourYesHour of birth (0–23). Required for accurate palace placement — Zi Wei palace positions shift by birth hour.
birth_locationNoCity and country of birth. Used for timezone context.
genderYesGender affects 四化 (sihua) transformation assignments.
focus_palaceNoOptional. Focus the narrative on this palace. If omitted, returns highlights across all twelve.

Implementation Reference

  • Handler function for the ming_zwds_chart tool. Calls generateZwds() engine client and optionally adds focus_palace annotation.
    handler: async (args) => {
      const raw = (await generateZwds({
        date: args.birth_date as string,
        hour: args.birth_hour as number,
        gender: args.gender as string,
      })) as Record<string, unknown>;
    
      // If focus_palace requested, annotate which palace is highlighted
      const result: Record<string, unknown> = { ...raw };
      if (args.focus_palace) {
        result.focus_palace = args.focus_palace;
        result.focus_note =
          `Focused on ${args.focus_palace} palace. See 'palaces' key for full twelve-palace data.`;
      }
      return JSON.stringify(result, null, 2);
    },
  • Input schema for ming_zwds_chart: requires birth_date, birth_hour, gender; optional birth_location and focus_palace.
    inputSchema: {
      type: "object",
      properties: {
        birth_date: {
          type: "string",
          format: "date",
          description: "Date of birth in YYYY-MM-DD format.",
        },
        birth_hour: {
          type: "integer",
          minimum: 0,
          maximum: 23,
          description:
            "Hour of birth (0–23). Required for accurate palace placement — " +
            "Zi Wei palace positions shift by birth hour.",
        },
        birth_location: {
          type: "string",
          description: "City and country of birth. Used for timezone context.",
        },
        gender: {
          type: "string",
          enum: ["male", "female"],
          description: "Gender affects 四化 (sihua) transformation assignments.",
        },
        focus_palace: {
          type: "string",
          enum: PALACE_KEYS,
          description:
            "Optional. Focus the narrative on this palace. If omitted, returns highlights across all twelve.",
        },
      },
      required: ["birth_date", "birth_hour", "gender"],
    },
  • The tool is registered in the TOOLS array via zwdsTool export.
    export const TOOLS = [baziTool, qmdjTool, zwdsTool, fengshuiTool, ichingTool, forecastTool];
  • generateZwds helper function — HTTP client that POSTs to the /zwds FastAPI endpoint.
    export interface ZwdsParams {
      date: string;
      hour: number;
      gender: string;
    }
    
    export async function generateZwds(params: ZwdsParams): Promise<unknown> {
      const url = buildUrl("/zwds", { date: params.date, hour: params.hour, gender: params.gender });
      const res = await fetch(url.toString(), {
        method: "POST",
        signal: AbortSignal.timeout(TIMEOUT_MS),
      });
      return handleResponse(res, "/zwds");
    }
  • src/index.ts:11-40 (registration)
    MCP server registers all tools via TOOLS.map in ListToolsRequestSchema handler and dispatches to tool.handler in CallToolRequestSchema.
     *   ming_zwds_chart            Zi Wei Dou Shu twelve-palace chart
     *   ming_fengshui_flying_stars Kua number + directional analysis
     *   ming_iching_cast           I Ching hexagram (Liu Yao method)
     *   ming_full_forecast         Five-engine integrated forecast
     */
    
    import { Server } from "@modelcontextprotocol/sdk/server/index.js";
    import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
    import {
      CallToolRequestSchema,
      ErrorCode,
      ListToolsRequestSchema,
      McpError,
    } from "@modelcontextprotocol/sdk/types.js";
    import { TOOLS } from "./tools/index.js";
    
    const server = new Server(
      {
        name: "ming-metaphysics-mcp",
        version: "1.0.0",
      },
      {
        capabilities: { tools: {} },
      }
    );
    
    // ── List tools ────────────────────────────────────────────────────────────────
    
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS.map((t) => t.definition),
Behavior2/5

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

Without annotations, the description should clarify behavioral traits. It states the tool 'computes' and 'returns' data, implying no side effects, but does not explicitly state read-only status, auth requirements, or limitations. The verification claim adds trust but not behavioral transparency.

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 highly concise (two sentences) and front-loaded with the core action. Every word adds value: computes, returns specific items, verification.

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?

Despite the complexity of ZWDS, the description outlines key output categories but does not specify output format or structure. Without an output schema, more detail on the return value (e.g., narrative vs. structured data) would improve completeness.

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?

All five parameters have descriptions in the input schema (100% coverage), so the description adds no extra semantic value. The tool description mentions 'specific question domain' which vaguely relates to the optional focus_palace parameter but does not elaborate.

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 computes a ZWDS natal chart and lists specific outputs (palace highlights, starred positions, 四化). The mention of verification against 紫微斗數全書 adds credibility. While sibling tool names are diverse, the description does not explicitly contrast with them, but the technical specificity makes its purpose unambiguous.

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 choose this tool over sibling tools. It does not state prerequisites, exclusions, or complementary use cases.

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/Espivc/ming-mcp'

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