ming_fengshui_flying_stars
Compute your Kua number and annual Flying Star map to identify favorable and unfavorable directions. Use this tool to synthesize directional advice based on Eight Mansions and yearly star positions for improved feng shui.
Instructions
Compute the Kua number (卦命), directional analysis, and annual Flying Star map (年飛星) for a person. Returns Kua group, favorable/unfavorable directions per Eight Mansions (八宅法), the nine-palace annual star chart for the requested year, and a five-engine directional synthesis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | Year for the annual Flying Star map (年飛星). Range 1700–2100. Defaults to current year when omitted. | |
| birth_date | Yes | Date of birth in YYYY-MM-DD format — used to compute the Kua number. | |
| gender | Yes | Gender is required for Kua number calculation. | |
| location_description | No | Optional. Description of the property (e.g. 'apartment, front door faces North'). |
Implementation Reference
- src/tools/fengshui.ts:42-75 (handler)The handler function that executes the ming_fengshui_flying_stars tool logic. It calls runConsult (HTTP POST /consult), extracts fengshui/combined fields from the response, and returns a structured JSON result with Kua number, directions, annual star map, and five-engine synthesis.
handler: async (args) => { const raw = (await runConsult({ date: args.birth_date as string, gender: args.gender as string, goal: "general", year: args.year as number, })) as Record<string, unknown>; const fengshui = raw.fengshui as Record<string, unknown> | undefined; const combined = raw.combined as Record<string, unknown> | undefined; const result = { requested_year: args.year, location_description: args.location_description ?? null, kua_number: fengshui?.kua ?? null, kua_name: fengshui?.kua_name ?? null, kua_group: fengshui?.group ?? null, favorable_directions: fengshui?.favorable ?? null, unfavorable_directions: fengshui?.unfavorable ?? null, all_favorable_dirs: fengshui?.all_favorable_dirs ?? null, all_unfavorable_dirs: fengshui?.all_unfavorable_dirs ?? null, power_direction: fengshui?.power_direction ?? null, annual_star_map: fengshui?.annual_star_map ?? null, annual_star_year: fengshui?.annual_star_year ?? args.year, five_engine_synthesis: { best_directions: combined?.best_directions ?? null, confidence: combined?.confidence ?? null, signals: combined?.signals ?? null, warnings: combined?.warnings ?? null, recommendation: combined?.recommendation ?? null, }, }; return JSON.stringify(result, null, 2); }, - src/tools/fengshui.ts:11-39 (schema)Input schema for ming_fengshui_flying_stars: validates year (1700-2100), birth_date (YYYY-MM-DD), gender (male/female), and optional location_description.
inputSchema: { type: "object", properties: { year: { type: "integer", minimum: 1700, maximum: 2100, description: "Year for the annual Flying Star map (年飛星). Range 1700–2100. " + "Defaults to current year when omitted.", }, birth_date: { type: "string", format: "date", description: "Date of birth in YYYY-MM-DD format — used to compute the Kua number.", }, gender: { type: "string", enum: ["male", "female"], description: "Gender is required for Kua number calculation.", }, location_description: { type: "string", description: "Optional. Description of the property (e.g. 'apartment, front door faces North').", }, }, required: ["year", "birth_date", "gender"], }, - src/tools/index.ts:16-16 (registration)TOOLS array registration — fengshuiTool (containing definition + handler) is included in the array of all MCP tools.
export const TOOLS = [baziTool, qmdjTool, zwdsTool, fengshuiTool, ichingTool, forecastTool]; - src/tools/index.ts:4-4 (registration)Re-export of fengshuiTool from fengshui.ts module.
export { fengshuiTool } from "./fengshui.js"; - src/engines-client.ts:122-139 (helper)The runConsult helper function that makes the actual HTTP POST request to the Ming engine's /consult endpoint, which is called by the fengshui handler.
export async function runConsult(params: ConsultParams): Promise<unknown> { const url = buildUrl("/consult", { date: params.date, hour: params.hour, gender: params.gender, question: params.question, goal: params.goal, target_date: params.target_date, iching_number: params.iching_number, year: params.year, forecast_year: params.forecast_year, }); const res = await fetch(url.toString(), { method: "POST", signal: AbortSignal.timeout(TIMEOUT_MS), }); return handleResponse(res, "/consult"); }