Skip to content

feat: 新增 get_pricing tool 與方案價格知識包,修正失效的升級連結 - #24

Merged
linsamtw merged 1 commit into
masterfrom
feature/pricing-knowledge
Sep 29, 2026
Merged

linsamtw merged 1 commit into
masterfrom
feature/pricing-knowledge

Conversation

@linsamtw

Copy link
Copy Markdown
Contributor

背景

  • AI 透過 MCP 或 Custom GPT 被問「FinMind 多少錢」時,知識包裡只有等級名稱、沒有金額,無法回答。
  • 402/429 錯誤訊息的升級連結 https://finmindtrade.com/analysis/#/account/pricing 在官網路由不存在,正確的是 #/Sponsor/sponsor。

修改

  • 新增 knowledge/pricing.md:四個方案的月繳/年繳(TWD)、API 上限、付款與升級規則、各方案新增重點、授權規則。內容與 FinMind-Doc #220 的價格頁一致。
  • 新增第 5 個 tool get_pricing:讀 pricing.md,不需連線、不需 token。同一份檔案也註冊成 finmind://pricing resource。
  • 離線 tool 不再需要 token:dispatch 讓 list_datasets、get_pricing 在建立 client 之前就處理。原本沒設 FINMIND_TOKEN 時,連 dataset 清單都會回授權錯誤。
  • 修正升級連結:errors.md 和 knowledge.py 的 fallback 模板改成 #/Sponsor/sponsor。
  • errors.md:Free 上限改為「300(註冊帶 token 600)」;刪掉 429 觸發條件裡重複的上限清單,讓 GPT instructions 回到 8,000 字以內(現 7,942)。
  • Custom GPT:knowledge_bundle.md 附上 pricing.md。
  • 同步文件與計數:SKILL.md、spec、README 的 tool 表加上 get_pricing;smoke 改成 5 個 tool。

驗證

  • pytest:36 passed(新增 get_pricing、無 token 離線 tool、pricing resource、知識包無失效連結等測試)
  • smoke.py:SMOKE OK,列出 5 個 tool
  • build_instructions.py:7,942/8,000;bundle 已含價格,instructions 與 bundle 都沒有 account/pricing

merge 後

  • 下新 tag 發 PyPI,使用者端才會有 get_pricing
  • 重新產生並重貼 Custom GPT 的 instructions 與 knowledge bundle
  • 價格現在寫在 vueweb、FinMind-Doc、FinMind-MCP 三處,改價時三處都要改

AI 透過 MCP/Custom GPT 被問到 FinMind 價格時沒有任何資料可答;
且 402/429 錯誤訊息的升級連結 #/account/pricing 在官網不存在。

修改檔案:
- knowledge/pricing.md(新增):四個方案月繳/年繳(TWD)、API 上限、
  資料集數、付款與升級規則、各方案新增重點、授權規則、購買連結
  https://finmindtrade.com/analysis/#/Sponsor/sponsor
- src/finmind_mcp/tools.py:新增第 5 個 tool get_pricing(讀 pricing.md);
  dispatch 讓離線 tool(list_datasets、get_pricing)在建立 client 前處理,
  沒有 FINMIND_TOKEN 也能查價格與 dataset 清單
- src/finmind_mcp/knowledge.py:註冊 finmind://pricing resource;
  fallback 模板升級連結改為 #/Sponsor/sponsor
- knowledge/errors.md:402/429 升級連結改為 #/Sponsor/sponsor;
  Free 上限改為 300(註冊帶 token 600);429 觸發條件刪除重複的上限清單
  (GPT instructions 8000 字上限,現 7942)
- knowledge/datasets.md:Tier 說明加指向 pricing.md/get_pricing
- chatgpt/build_instructions.py:knowledge_bundle.md 附上 pricing.md
- skills/finmind/SKILL.md、docs/spec.md、docs/mcp-original-readme.md:tool 清單加 get_pricing
- src/finmind_mcp/server.py、smoke.py:tool 數 4 → 5
- tests/test_tools.py:tool 清單改 5 個;新增 get_pricing、無 token 離線 tool 測試;
  402 測試改驗新連結
- tests/test_knowledge.py:新增 pricing resource 可讀、知識包無失效連結測試

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linsamtw
linsamtw merged commit c921f41 into master Sep 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant