{"components":{"schemas":{"BirthRequest":{"additionalProperties":false,"description":"工具 / HTTP 共用的生辰字段。未知字段拒绝，拼错的闰月或时辰键不会被忽略；其余校验在 [`BirthRequest::parse`]。","properties":{"calendar":{"$ref":"#/components/schemas/Calendar","default":"solar","description":"历法。`solar` 公历，`lunar` 农历。默认 `solar`。"},"clock":{"default":null,"description":"出生钟点 `HH:MM`（24 小时制，也接受 `H:MM`）。23:00–23:59 为晚子（12），00:00–00:59 为早子（0）。不要把 23 点写成 0。","type":["string","null"]},"date":{"description":"出生日期，格式 `YYYY-M-D` 或 `YYYY-MM-DD`，不含钟点。公历范围 1–9999。","type":"string"},"fix_leap":{"default":true,"description":"公历排盘是否按 iztro `fixLeap` 处理农历换算。默认 `true`。","type":"boolean"},"gender":{"description":"性别。`male` / `female`，也接受 `男` / `女`。","type":"string"},"language":{"default":"zh-CN","description":"文本语言码：`zh-CN` `zh-TW` `en-US` `ja-JP` `ko-KR` `vi-VN`。默认 `zh-CN`。给模型读盘请用中文盘。","type":"string"},"leap":{"$ref":"#/components/schemas/LeapKind","default":"not_leap","description":"农历闰月：`not_leap` / `leap` / `leap_fixed`，默认 `not_leap`。`calendar=solar` 时只能省略或 `not_leap`。"},"time_index":{"default":null,"description":"时辰序号 0–12。0 早子（00:00–00:59），1 丑（01:00–02:59），2 寅（03:00–04:59），3 卯（05:00–06:59），4 辰（07:00–08:59），5 巳（09:00–10:59），6 午（11:00–12:59），7 未（13:00–14:59），8 申（15:00–16:59），9 酉（17:00–18:59），10 戌（19:00–20:59），11 亥（21:00–22:59），12 晚子（23:00–23:59）。与 `clock` 至少填一个；两个都填时必须指向同一时辰。","format":"uint8","maximum":12,"minimum":0,"type":["integer","null"]}},"required":["date","gender"],"type":"object"},"Calendar":{"description":"历法。默认公历。","oneOf":[{"const":"solar","description":"公历（格里历）。","type":"string"},{"const":"lunar","description":"农历；闰月由 [`LeapKind`] 单独表达，不用两个相邻布尔。","type":"string"}]},"Catalog":{"description":"知识包目录：有哪些条目可查，以及显示名与标识的对应。","properties":{"pack":{"$ref":"#/components/schemas/PackInfo","description":"目录所属的包。"},"sections":{"description":"各段，顺序为星耀、格局、宫位、四化、术语、主题；只请求一段时只有那一段。","items":{"$ref":"#/components/schemas/CatalogSection"},"type":"array"}},"required":["pack","sections"],"type":"object"},"CatalogItem":{"description":"目录里的一行。","properties":{"key":{"description":"语言无关标识，可直接用于查询。","type":"string"},"name":{"description":"显示名（术语与主题为标题）；包未写则为 `None`。","type":["string","null"]}},"required":["key"],"type":"object"},"CatalogRequest":{"additionalProperties":false,"description":"`ziwei_list_knowledge` / `POST /v1/catalog` 入参。","properties":{"kind":{"anyOf":[{"$ref":"#/components/schemas/Kind"},{"type":"null"}],"default":null,"description":"只列某一段；省略则列全部。"},"pack":{"default":null,"description":"知识包，规则同 `ziwei_get_natal_chart`。","type":["string","null"]}},"title":"CatalogRequest","type":"object"},"CatalogResponse":{"description":"JSON 接口的统一信封。","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/Catalog"},{"type":"null"}],"description":"成功时的载荷；失败时为 `null`，不会缺这个键。"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorBody"},{"type":"null"}],"description":"失败时的错误。"},"ok":{"description":"是否成功。","type":"boolean"}},"required":["ok"],"title":"Envelope","type":"object"},"CatalogSection":{"description":"目录里的一段。","properties":{"items":{"description":"该段的条目，按标识排序。","items":{"$ref":"#/components/schemas/CatalogItem"},"type":"array"},"kind":{"$ref":"#/components/schemas/Kind","description":"条目段。"}},"required":["kind","items"],"type":"object"},"ChartRequest":{"additionalProperties":false,"description":"`ziwei_get_natal_chart` / `POST /v1/chart` 入参。","properties":{"birth":{"$ref":"#/components/schemas/BirthRequest","description":"生辰。"},"detail":{"$ref":"#/components/schemas/Detail","default":"full","description":"事实详略：`full`（默认）或 `overview`。"},"knowledge":{"anyOf":[{"$ref":"#/components/schemas/Depth"},{"type":"null"}],"default":null,"description":"是否在事实后附知识包释义：`summary` 或 `full`。省略则只返回事实。"},"pack":{"default":null,"description":"知识包。省略或 `builtin` 为默认包；`file:…` 与 `https://…` 须在服务的白名单内，公网服务只有默认包。","type":["string","null"]}},"required":["birth"],"title":"ChartRequest","type":"object"},"Depth":{"description":"知识包释义附多长。","oneOf":[{"const":"summary","description":"条目摘要；正文不超过 120 个汉字的条目取正文本身。格局不附成立条件。","type":"string"},{"const":"full","description":"条目正文全文，格局附成立条件。","type":"string"}]},"Detail":{"description":"事实写到多细。","oneOf":[{"const":"full","description":"全部事实：本命含十二宫详解（三方四正、宫干飞化、十二神、小限），运限的大限与流年展开十二宫表。","type":"string"},{"const":"overview","description":"总览：本命只有基本信息、十二宫总览表与格局；运限各层只写宫名对照、四化、流耀与格局。","type":"string"}]},"Entries":{"description":"一次查询的结果。","properties":{"entries":{"description":"与请求的标识一一对应、顺序相同。","items":{"$ref":"#/components/schemas/Entry"},"type":"array"},"pack":{"$ref":"#/components/schemas/PackInfo","description":"条目所属的包。"}},"required":["pack","entries"],"type":"object"},"Entry":{"description":"查到的一条。","properties":{"entry":{"description":"包里该条目的原样内容：名称、正文、摘要，星耀另有门派属性与双星组合，格局另有古籍引文与成立条件，\n主题另有选宫定义（`surround` 连三方四正、`palaces` 只取本宫）。包没写的字段不出现。"},"key":{"description":"查询用的标识。","type":"string"},"kind":{"$ref":"#/components/schemas/Kind","description":"所属条目段。"}},"required":["kind","key","entry"],"type":"object"},"ErrorBody":{"description":"对外错误体。","properties":{"code":{"description":"机器可读分类。","type":"string"},"message":{"description":"给人看的说明。","type":"string"},"retryable":{"description":"出站依赖故障为 `true`。","type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"ErrorResponse":{"description":"JSON 接口的统一信封。","properties":{"data":{"description":"成功时的载荷；失败时为 `null`，不会缺这个键。","type":"null"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorBody"},{"type":"null"}],"description":"失败时的错误。"},"ok":{"description":"是否成功。","type":"boolean"}},"required":["ok"],"title":"Envelope","type":"object"},"HoroscopeRequest":{"additionalProperties":false,"description":"`ziwei_get_horoscope` / `POST /v1/horoscope` 入参。","properties":{"birth":{"$ref":"#/components/schemas/BirthRequest","description":"生辰。"},"detail":{"$ref":"#/components/schemas/Detail","default":"full","description":"事实详略：`full`（默认）或 `overview`。"},"knowledge":{"anyOf":[{"$ref":"#/components/schemas/Depth"},{"type":"null"}],"default":null,"description":"是否附流耀与行运格局的知识包释义：`summary` 或 `full`。省略则只返回事实。"},"pack":{"default":null,"description":"知识包，规则同 `ziwei_get_natal_chart`。","type":["string","null"]},"target":{"$ref":"#/components/schemas/TargetRequest","description":"运限目标：公历日期与时辰。"}},"required":["birth","target"],"title":"HoroscopeRequest","type":"object"},"Kind":{"description":"知识包的条目段。","oneOf":[{"const":"star","description":"星耀，标识如 `ziweiMaj`。","type":"string"},{"const":"pattern","description":"格局，标识如 `zi_fu_tong_gong`。","type":"string"},{"const":"palace","description":"宫位，标识如 `soulPalace`。","type":"string"},{"const":"mutagen","description":"四化，标识如 `sihuaLu`。","type":"string"},{"const":"concept","description":"术语，标识是知识包自定义的 slug。","type":"string"},{"const":"topic","description":"解读主题（读这类问题看哪些宫），标识是知识包自定义的 slug。","type":"string"}]},"LeapKind":{"description":"农历闰月处理。非闰月输入必须是 [`LeapKind::NotLeap`]。","oneOf":[{"const":"not_leap","description":"该月不是闰月。","type":"string"},{"const":"leap","description":"该月是闰月，按闰月本身排盘。","type":"string"},{"const":"leap_fixed","description":"该月是闰月，且十五之后视作次月（iztro `fixLeap`）。","type":"string"}]},"LookupRequest":{"additionalProperties":false,"description":"`ziwei_lookup_knowledge` / `POST /v1/lookup` 入参。","properties":{"keys":{"description":"语言无关标识，1 到 20 个，取自 `ziwei_list_knowledge`；不接受译名。","items":{"type":"string"},"maxItems":20,"minItems":1,"type":"array"},"kind":{"$ref":"#/components/schemas/Kind","description":"条目段：`star` / `pattern` / `palace` / `mutagen` / `concept` / `topic`。"},"pack":{"default":null,"description":"知识包，规则同 `ziwei_get_natal_chart`。","type":["string","null"]}},"required":["kind","keys"],"title":"LookupRequest","type":"object"},"LookupResponse":{"description":"JSON 接口的统一信封。","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/Entries"},{"type":"null"}],"description":"成功时的载荷；失败时为 `null`，不会缺这个键。"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorBody"},{"type":"null"}],"description":"失败时的错误。"},"ok":{"description":"是否成功。","type":"boolean"}},"required":["ok"],"title":"Envelope","type":"object"},"PackInfo":{"description":"结果所依据的知识包。","properties":{"id":{"description":"知识包 `id`。","type":"string"},"language":{"description":"知识包文本语言码。","type":"string"},"version":{"description":"知识包 `version`。","type":"string"}},"required":["id","version","language"],"type":"object"},"TargetRequest":{"additionalProperties":false,"description":"运限目标。日期恒为公历；时辰必须显式给出，不继承出生时辰，也不读取当前时间。","properties":{"clock":{"default":null,"description":"目标钟点 `HH:MM`。23:00–23:59 为晚子（12）。","type":["string","null"]},"date":{"description":"目标公历日期 `YYYY-M-D`，不含钟点。","type":"string"},"time_index":{"default":null,"description":"目标时辰序号 0–12，取值同出生时辰。与 `clock` 至少填一个；两个都填时必须指向同一时辰。","format":"uint8","maximum":12,"minimum":0,"type":["integer","null"]}},"required":["date"],"type":"object"},"TextResponse":{"description":"JSON 接口的统一信封。","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/TextView"},{"type":"null"}],"description":"成功时的载荷；失败时为 `null`，不会缺这个键。"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorBody"},{"type":"null"}],"description":"失败时的错误。"},"ok":{"description":"是否成功。","type":"boolean"}},"required":["ok"],"title":"Envelope","type":"object"},"TextView":{"description":"文本类工具的结果。","properties":{"language":{"description":"正文语言码。","type":"string"},"pack":{"anyOf":[{"$ref":"#/components/schemas/PackInfo"},{"type":"null"}],"description":"正文里的释义与主题定义所依据的知识包；只有事实时为 `None`。"},"text":{"description":"Markdown 正文。","type":"string"}},"required":["text","language"],"type":"object"},"TopicRequest":{"additionalProperties":false,"description":"`ziwei_get_topic_palaces` / `POST /v1/topic` 入参。","properties":{"birth":{"$ref":"#/components/schemas/BirthRequest","description":"生辰。"},"detail":{"$ref":"#/components/schemas/Detail","default":"full","description":"事实详略：`full`（默认）或 `overview`。"},"knowledge":{"$ref":"#/components/schemas/Depth","default":"summary","description":"释义深度：`summary`（默认）或 `full`。"},"pack":{"default":null,"description":"知识包，规则同 `ziwei_get_natal_chart`。主题的选宫定义与释义都取自它。","type":["string","null"]},"topic":{"description":"主题 slug，取自知识包目录里 `kind=topic` 的条目，如默认包的 `romance`、`career`、`wealth`。","type":"string"}},"required":["birth","topic"],"title":"TopicRequest","type":"object"}}},"info":{"description":"紫微斗数排盘、运限与知识资料查询。盘面由 x-iztro 计算；知识文本注明来源，是一种资料观点，不代表唯一解盘方法。","title":"x-ziwei","version":"0.1.0"},"openapi":"3.1.0","paths":{"/v1/catalog":{"post":{"operationId":"ziwei_list_knowledge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}},"description":"成功，data 为计算或查询结果。"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"参数非法，或知识条目、主题不存在"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"限流，请稍后重试"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"内部错误"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"知识包不可用"}},"summary":"列出知识包目录：条目标识与显示名。","x-openai-isConsequential":false}},"/v1/chart":{"post":{"operationId":"ziwei_get_natal_chart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextResponse"}}},"description":"成功，data 为计算或查询结果。"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"参数非法，或知识条目、主题不存在"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"限流，请稍后重试"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"内部错误"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"知识包不可用"}},"summary":"本命盘事实（Markdown），可选附知识包释义；不含解读结论。","x-openai-isConsequential":false}},"/v1/horoscope":{"post":{"operationId":"ziwei_get_horoscope","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoroscopeRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextResponse"}}},"description":"成功，data 为计算或查询结果。"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"参数非法，或知识条目、主题不存在"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"限流，请稍后重试"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"内部错误"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"知识包不可用"}},"summary":"明确目标日期与时辰的运限事实：大限、小限、流年、流月、流日、流时。","x-openai-isConsequential":false}},"/v1/lookup":{"post":{"operationId":"ziwei_lookup_knowledge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}},"description":"成功，data 为计算或查询结果。"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"参数非法，或知识条目、主题不存在"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"限流，请稍后重试"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"内部错误"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"知识包不可用"}},"summary":"按语言无关标识查知识包条目原文与来源。","x-openai-isConsequential":false}},"/v1/topic":{"post":{"operationId":"ziwei_get_topic_palaces","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextResponse"}}},"description":"成功，data 为计算或查询结果。"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"参数非法，或知识条目、主题不存在"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"限流，请稍后重试"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"内部错误"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"知识包不可用"}},"summary":"按知识包里的主题定义取本命宫位事实与释义；选宫由知识包决定。","x-openai-isConsequential":false}}},"security":[],"servers":[{"url":"https://ziwei-mcp.x-haose.com"}]}