# D8ly agent examples / D8ly 代理範例

## Choose a connector / 選擇連接方式

- Public: https://d8ly.app/mcp?source=integration_example — three deterministic Bazi/almanac tools, no key, no generative AI. / 公開端點：三個確定式八字與黃曆工具，無需金鑰，不使用生成式 AI。
- Authenticated: https://d8ly.app/mcp/readings?source=integration_example — compatibility, one-card Tarot, phone-number energy; send Authorization: Bearer YOUR_API_KEY in a header, never a URL. / 需驗證端點：合盤、單張塔羅、電話號碼能量；請在標頭傳送金鑰，勿放入網址。
- Create a separate key per integration at https://d8ly.app/settings/api-keys. The account shares 100 reading calls/day across keys and REST/MCP. Connecting and discovering tools do not use the reading quota. / 在設定頁為每個整合建立獨立金鑰；各金鑰及 REST/MCP 共用每帳戶每日 100 次解讀配額。連接及探索工具不消耗解讀配額。
- Client configuration formats differ. In a remote-MCP client, use its server URL and secret-header settings. If it cannot securely attach bearer headers, use REST from a backend instead. / 各用戶端設定格式不同，請使用遠端 MCP 網址及機密標頭設定；若無法安全傳送金鑰，請改由後端使用 REST。

## Public almanac / 公開黃曆

Prompt: Show suitable and unsuitable activities for 2026-10-18. / 提示：請查 2026-10-18 的宜忌。

Tool: get_daily_almanac

```json
{"date":"2026-10-18","locale":"zh"}
```

The output includes activities.suitable, activities.unsuitable, lunar_date, day_pillar and zodiac_clash under data. This is date-only traditional almanac data, not a personalized guarantee or a ranked date-selection service. / data 包含宜忌、農曆、日柱及生肖相沖；這是依日期查詢的傳統黃曆，並非個人化保證或吉日排名服務。

## Complete Bazi chart / 完整八字命盤

Tool: calculate_bazi_chart (public connector / 公開端點)

```json
{"birth_date":"1990-05-15","birth_time":"08:30","latitude":25.033,"longitude":121.5654,"timezone":8,"locale":"en"}
```

All birth details here are synthetic. For real requests obtain permission and the historical UTC offset, not today's offset. If birth time or location is unknown, ask; do not invent noon or coordinates. / 本頁出生資料皆為測試資料；真實查詢需取得同意及出生當時的 UTC 時差。若出生時間或地點不明，應先詢問，不可假設中午或經緯度。

## Compare two charts without AI generation / 不使用 AI 生成的雙人合盤

Tool: calculate_bazi_compatibility (authenticated connector / 需驗證端點)

```json
{"person1":{"date":"1990-05-15","time":"08:30","latitude":25.033,"longitude":121.5654,"timezone":8},"person2":{"date":"1988-02-10","time":"14:20","latitude":22.3193,"longitude":114.1694,"timezone":8},"locale":"zh","includeNarrative":false}
```

Interpret the traditional interactions, not whether a person is trustworthy or whether a relationship must succeed. AI narrative is optional and off by default in MCP. / 解釋傳統互動，不判定他人是否可信或關係必然成敗。MCP 的 AI 解讀為選用功能，預設關閉。

## Single-card Tarot / 單張塔羅

Tool: draw_tarot_card (authenticated connector / 需驗證端點)

```json
{"cardId":0,"reversed":false,"question":"What could I reflect on before starting a creative project?"}
```

The example question means「開始創作計畫前，我可以反思什麼？」. Supplying cardId and reversed selects a known card; omitting either randomizes it. The interpretation always uses an external model and existing generation logs, even with a fixed card. This is one card, not a three-card spread. No model call is made by reading this documentation. / 指定牌及正逆位可固定抽牌，省略時則隨機決定；即使固定牌，解讀仍使用外部模型與既有生成紀錄。此工具僅抽一張牌，並非三張牌陣。閱讀本文件不會呼叫模型。

## Phone-number energy without AI / 不使用 AI 的電話號碼能量

Tool: analyze_number_energy (authenticated connector / 需驗證端點)

```json
{"phone":"1234567890","locale":"zh","includeAi":false}
```

This number is a synthetic fixture. The tool uses digit-pair number-energy rules; it is not birth-date Life Path numerology. / 號碼為測試資料；工具使用數字配對能量規則，並非依生日計算的生命靈數。

The equivalent backend REST call is below. Keep the key in a secret environment variable; never ship it to browser code. / 以下為對應的後端 REST 呼叫；金鑰應存於機密環境變數，不可放入瀏覽器程式。

```sh
curl --fail-with-body https://d8ly.app/api/v1/number-energy?source=integration_example \
  -H "Authorization: Bearer $D8LY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"phone":"1234567890","locale":"zh","includeAi":false}'
```

## Boundaries and errors / 範圍與錯誤

- 401: missing/invalid/revoked key; reconnect with a valid key. 429: daily quota reached; stop retries until the next UTC day. / 401：金鑰遺失、無效或已撤銷；429：已達每日配額，請等下一個 UTC 日期再試。
- A successful HTTP transport can contain an MCP error: inspect JSON-RPC error and result.isError, not just HTTP 200. / HTTP 成功仍可能包含 MCP 錯誤，請檢查 JSON-RPC error 及 result.isError。
- Zi Wei, yearly outlook, name analysis, fortune sticks, moon blocks, three-card Tarot, and date ranking are not exposed by these MCP connectors. Website availability does not imply an agent tool exists. / 紫微、流年、姓名、籤詩、筊杯、三張塔羅及吉日排名尚未由這些 MCP 端點提供；網站功能不代表已有代理工具。
- Authenticated readings consume quota and can retain generation inputs/outputs in existing service logs. Analytics separately excludes keys, birth data, questions, phone numbers and readings; it uses a derived per-key integration identifier. / 需驗證的解讀會消耗配額，既有服務紀錄可能留存生成輸入與輸出。分析事件另行排除金鑰、出生資料、問題、電話號碼及解讀，僅使用衍生的每金鑰整合識別碼。
- For entertainment and personal reflection only, not medical, financial, legal or other professional advice. / 僅供娛樂與個人反思，不作醫療、財務、法律或其他專業建議。

[OpenAPI](https://d8ly.app/openapi.json) · [Full reference / 完整參考](https://d8ly.app/llms-full.txt) · [Privacy / 隱私](https://d8ly.app/privacy)
