mcp-taiwan-legal-db-integrated
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-taiwan-legal-db-integratedsearch for latest Supreme Court rulings on copyright infringement"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-taiwan-legal-db(整合版)🌟🏗️
English · 繁體中文
本專案為 mcp-taiwan-legal-db(LawChat 原版)→ mcp-taiwan-legal-db-enhanced(增補版)的整合版本
原專案 mcp-taiwan-legal-db 是一個由 LawChat 所開發的 MCP Server,其功能在於讓任何 MCP 相容的 AI 助手直接存取台灣公開法律資料:
司法院裁判書 — judgment.judicial.gov.tw(全文搜尋 + 取得)
全國法規資料庫 — law.moj.gov.tw(11,700+ 部法規)
憲法法庭 — cons.judicial.gov.tw(868 筆大法官解釋 + 憲判字,含理由書全文,離線快取)
增補版 在原專案架構上增設:
🌟 簡易案件系統查詢 🌟 判解函釋查詢系統(包含精選裁判、判例、司法解釋、決議、法律問題) 🌟 裁判書進階搜尋與分頁機制
而本整合版在增補版的全部功能之上,再加入:
🏗️ 工程會函釋查詢(行政院公共工程委員會「政府採購法規解釋函令」,3,600+ 則離線快取,1988–2026) 🔄 三層自動更新:法規清單每週自動更新(沿用原版)+ 工程會函釋每 7 天自動增量抓新 + 程式碼每日自動檢查 GitHub 新版(下次重啟生效)
詳細增補內容請見 CHANGELOG.md。
特色
註:以下功能表格中,🌟 標記為增補版新增功能,🏗️ 標記為本整合版新增功能,其餘功能均繼承自原專案。
功能 | 說明 |
原版的 8 個 MCP 工具 | 裁判書搜尋/全文、法規查詢、釋字/憲判字查詢、引用關係圖譜 |
🌟 簡易案件系統 | 支援查詢地方法院簡易案件與小額案件(🌟 增補版功能) |
🌟 法令判解系統 | 支援查詢大法官解釋、決議、法律問題、精選裁判、行政函釋等(🌟 增補版功能) |
🌟 進階搜尋 | 裁判書分頁查詢、系統選擇、件數資訊(🌟 增補版功能) |
🏗️ 工程會函釋 | 政府採購法規解釋函令本地快取查詢(search_pcc_letters / get_pcc_letter),支援關鍵字、採購法條號、發文字號、日期、現行有效篩選(🏗️ 整合版功能) |
🔄 自動更新 | 法規清單(每週六)、工程會函釋(每 7 天增量)、程式碼(每日檢查 GitHub,下次重啟生效;設 |
離線快取 | 868 筆大法官解釋與憲判字(含理由書/意見書全文)從本地 JSON 即時回傳 |
引用關係圖譜 | 從理由書抽取所有引用的釋字/憲判字,追溯憲法學說演變 |
全文搜尋 | 裁判書關鍵字搜尋 + 釋字爭點/理由書全文搜尋 |
混合請求策略 | 預設用 httpx 直打(~0.25s),觸發司法院 F5 WAF 時自動以 Playwright 刷 cookie 後繼續 |
Related MCP server: KJH Law MCP
⚡ 快速上手
🪟 Windows 公務機懶人包(最簡單)
lazypack/ 內附全自動安裝懶人包:把資料夾內 5 個檔案放在同一目錄,
雙擊「安裝_台灣法律MCP整合版.bat」即可——自帶可攜 Python、免 git、免管理員權限,
裝完自我診斷並在桌面留報告。曾安裝增補版或獨立工程會函釋 MCP 者會自動就地升級。
詳見 lazypack/使用說明.txt。
Linux / macOS
照順序執行下列指令(Python 3.10+ 適用)。
# 0. Debian / Ubuntu 前置安裝(若步驟 2 建立 venv 失敗時執行)
sudo apt install python3-venv python3-pip
# 1. Clone repo(整合版倉庫)
git clone https://github.com/oldbear-meme/mcp-taiwan-legal-db-integrated.git
cd mcp-taiwan-legal-db-integrated
# 2. 建立並初始化虛擬環境
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/pip install -e .
# 3. 安裝 Playwright Chromium(僅在司法院 WAF 觸發時使用,一般查詢不會啟動)
# macOS:
.venv/bin/python -m playwright install chromium
# Linux(需要安裝系統依賴,指令會要求 sudo 權限,僅完整支援 Debian/Ubuntu):
.venv/bin/python -m playwright install --with-deps chromium
# 4. 驗證伺服器安裝
.venv/bin/python verify.py預期輸出:
Server: 台灣法律資料庫
Tools: ['search_judgments', 'get_judgment', 'query_regulation', 'get_pcode', 'search_regulations', 'get_interpretation', 'search_interpretations', 'get_citations', 'search_legal_interpretations', 'search_legal_interpretations_advanced', 'get_legal_interpretation', 'search_pcc_letters', 'get_pcc_letter']
Setup OK(註:Tools 清單實際為單行輸出)
**完成!**Repo 根目錄已經帶一份 .mcp.json,任何在此資料夾內開的 Claude Code session 會自動載入這個 server,不需要額外註冊。
Windows
Windows 使用者請執行以下 PowerShell 指令(可整段複製貼上):
# 1. Clone repo(整合版倉庫)
git clone https://github.com/oldbear-meme/mcp-taiwan-legal-db-integrated.git
cd mcp-taiwan-legal-db-integrated
# 2. 建立並初始化虛擬環境
python -m venv .venv
.venv\Scripts\python -m pip install --upgrade pip
.venv\Scripts\pip install -e .
# 3. 安裝 Playwright Chromium(僅在司法院 WAF 觸發時使用,一般查詢不會啟動)
.venv\Scripts\python -m playwright install chromium
# 4. 驗證伺服器安裝
.venv\Scripts\python verify.py預期輸出:
Server: 台灣法律資料庫
Tools: ['search_judgments', 'get_judgment', 'query_regulation', 'get_pcode', 'search_regulations', 'get_interpretation', 'search_interpretations', 'get_citations', 'search_legal_interpretations', 'search_legal_interpretations_advanced', 'get_legal_interpretation', 'search_pcc_letters', 'get_pcc_letter']
Setup OK(註:Tools 清單實際為單行輸出)
⚙️ Windows 額外設定
Repo 根目錄的 .mcp.json 預設使用 Linux / macOS 路徑格式。Windows 使用者需要修改:
# 將 .mcp.json 中的 "command" 從
".venv/bin/python"
# 改為
".venv\Scripts\python.exe"或參考下方「註冊到你的 Claude client」章節的完整範例。
**完成!**修改 .mcp.json 後,任何在此資料夾內開的 Claude Code session 會自動載入這個 server,不需要額外註冊。
🔄 從原版本遷移
如果你之前安裝過原作者的 mcp-taiwan-legal-db,建議先移除再安裝整合版,避免套件衝突。
移除原版本
根據你的安裝方式選擇對應的移除指令:
pip 安裝的情況:
# Windows (PowerShell / CMD)
pip uninstall mcp-taiwan-legal-db
# Linux / macOS
pip3 uninstall mcp-taiwan-legal-dbpipx 安裝的情況:
pipx uninstall mcp-taiwan-legal-dbuv 安裝的情況:
uv tool uninstall mcp-taiwan-legal-db安裝整合版
移除原版本後,依照上方「快速上手」章節的步驟安裝整合版即可。
MCP 設定更新
如果你在 Claude Desktop 或其他 MCP client 中設定過原版本,需要更新設定檔:
Claude Desktop 設定檔位置:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonWindows (Microsoft Store / MSIX 安裝):
C:\Users\<YourName>\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux: Claude Desktop 目前無 Linux 版,請改用 Claude Code CLI
將設定中的路徑改為指向整合版的安裝位置。
有什麼工具可以用
註:原版 8 個工具 + 增補版 3 個法令判解工具 + 整合版 2 個工程會函釋工具,共 13 個工具。此外,
search_judgments工具已增強支援簡易案件系統查詢、進階搜尋與分頁機制。
13 個 MCP 工具,全部唯讀,全部只打台灣政府的公開資料庫(工程會函釋為本地快取)。
法規與裁判(原專案功能)
工具 | 用途 | 典型呼叫 |
| 搜尋司法院裁判書資料庫(含 🌟 增補版功能─簡易案件查詢) |
|
| 依 JID 或 URL 取得單筆判決全文 |
|
| 查詢法規條文/範圍/全文/修法沿革 |
|
| 將法規名稱解析為 pcode(法規代號) |
|
| 以關鍵字搜尋 11,700+ 部法規 |
|
憲法法庭(原專案功能)
工具 | 用途 | 典型呼叫 |
| 大法官解釋/憲判字全文(離線快取) |
|
| 搜尋釋字/憲判字(爭點 + 理由書全文) |
|
| 引用關係圖譜(往前追溯) |
|
法令判解系統(🌟 增補版功能)
工具 | 用途 | 典型呼叫 |
| 搜尋司法院法令判解系統 |
|
| 進階搜尋(支援日期範圍) |
|
| 取得法令判解全文 |
|
工程會函釋(🏗️ 整合版功能)
工具 | 用途 | 典型呼叫 |
| 搜尋工程會「政府採購法規解釋函令」(本地快取,3,600+ 則) |
|
| 取得單則函釋全文(含現行有效狀態) |
|
資料來源:行政院公共工程委員會 政府採購法規解釋函令查詢系統(公開資訊)。 「已停止適用」標記係依內文關鍵字判定,非 100% 精準;正式引用前請於工程會官網核對最新狀態。
工具細節
註:以下工具細節說明主要來自原專案 README,本增補版本已根據新增功能進行更新。
搜尋司法院判決系統。支援:
精確案號查詢(快,HTTP GET):設定
case_word+case_number全文關鍵字搜尋:設定
keyword裁判主文篩選:
main_text="被告應將 移轉"+keyword="借名登記"→ 找被告敗訴的借名登記案可依
court、case_type(民事/刑事/行政/懲戒)、year_from/year_to過濾結果自動依法院層級排序(最高 → 高等 → 地方)
重要:要查某個特定案號時,一定要用 case_word+case_number,不要放進 keyword。查精確案號時不傳 year_from/year_to,因為案號年度與裁判日期年度可能不同。
# ✅ 正確 — 查台上 3753(最高法院)
search_judgments(case_word="台上", case_number="3753", court="最高法院")
# ✅ 正確 — 全文搜尋
search_judgments(keyword="預售屋 遲延交屋")
# ❌ 錯 — 把案號放進 keyword
search_judgments(keyword="114年度台上字第3753號")取得單筆判決的結構化全文。
輸入:
jid(從search_judgments結果取得)或url輸出:
{case_id, court, date, main_text, facts, reasoning, cited_statutes, cited_cases, full_text, source_url}HTTP GET data.aspx 取得全文
結果快取 30 天
get_judgment(jid="TPSM,114,台上,3753,20251112,1")單筆判決可能超過 1 萬 token。建議先用 search_judgments 取得 metadata,只在使用者明確需要時才抓全文。
查詢全國法規資料庫。
# 單一條文
query_regulation(law_name="民法", article_no="184")
# 條文範圍
query_regulation(law_name="民法", from_no="184", to_no="198")
# 完整法規
query_regulation(law_name="律師法")
# 附修法沿革
query_regulation(law_name="勞動基準法", article_no="23", include_history=True)支援 law_name(透過 get_pcode 自動解析 pcode)或直接傳 pcode。子條文如 247-1、15-1 都支援。
取得大法官解釋(釋字第 1–813 號)或憲法法庭裁判(憲判字)全文。預設層從本地 JSON 快取即時回傳。
分層設計(節省 context):
層級 | 觸發條件 | 離線? |
預設層(字號/日期/爭點/解釋文) | 永遠回傳 | ✓ |
理由書片段 |
| ✓ |
理由書全文(最多 15,000 字) |
| ✓ |
意見書片段 |
| ✓ |
意見書全文 |
| ✓ |
# 預設層(離線,~0ms)
get_interpretation("釋字748")
# 理由書中搜尋關鍵字
get_interpretation("釋字748", reasoning_keyword="婚姻自由")
# 在意見書中定位特定大法官
get_interpretation("釋字499", opinions_keyword="林子儀")
# 新制憲判字
get_interpretation("111年憲判字第1號")建議先用 keyword 片段模式定位,只在需要時才開全文模式。
搜尋大法官解釋與憲判字。關鍵字同時匹配標題、爭點、理由書全文。
# 全文搜尋(搜爭點 + 理由書)
search_interpretations(keyword="集會自由")
# 篩選年度(新制)
search_interpretations(keyword="言論自由", year=112)
# 列舉最後 10 筆釋字
search_interpretations(number_from=804, number_to=813)從理由書中抽取所有引用的釋字/憲判字字號。追溯方向:查詢指定裁判引用了哪些先前裁判。
get_citations("釋字748")
# → citations: [釋字第242號, 釋字第362號, 釋字第365號, ...]
# 附上引用前後 80 字片段
get_citations("釋字748", include_context=True)將法規名稱轉換為全國法規資料庫的 pcode(法規代碼)。支援模糊比對。
# 精確名稱
get_pcode(law_name="民法")
# 常用簡稱
get_pcode(law_name="勞基法")
# → 會建議「勞動基準法」
# 模糊搜尋
get_pcode(law_name="消保")
# → 會列出包含「消保」的法規供選擇以關鍵字搜尋全國法規資料庫的 11,700+ 部法規名稱。
# 搜尋包含「勞動」的法規
search_regulations(keyword="勞動")
# 搜尋智慧財產相關法規
search_regulations(keyword="智慧財產")
# 排除已廢止法規
search_regulations(keyword="銀行", exclude_abolished=True)搜尋司法院法令判解系統(legal.judicial.gov.tw/FINT)。可搜尋大法官解釋、憲法法庭裁判、決議、法律問題、精選裁判、行政函釋等。
# 關鍵字搜尋
search_legal_interpretations(keyword="不完全給付&瑕疵擔保")
# 指定文件類型
search_legal_interpretations(keyword="侵權行為", doc_type="精選裁判")
# 調整回傳筆數
search_legal_interpretations(keyword="租賃", max_results=50)支援布林運算:+(或)、-(不含)、&(且)、()(組合)
進階搜尋法令判解系統,支援日期範圍篩選。採用兩階段查詢設計:
第一階段:送出查詢條件,取得各類型件數(categories)
第二階段:根據 categories 的類型名稱,精確篩選結果
# 第一階段:查看 114 年有哪些類型
search_legal_interpretations_advanced(
date_from="114/1/1",
date_to="114/12/31"
)
# → categories: [{"name": "法律問題", "count": 80}, ...]
# 第二階段:取得全部法律問題
search_legal_interpretations_advanced(
date_from="114/1/1",
date_to="114/12/31",
doc_types=["法律問題"],
max_results=100
)取得法令判解系統單筆全文。從 search_legal_interpretations 結果的 ty 和 id 欄位帶入。
# ty 代碼對應(完整 10 種):
# JCC = 憲法法庭裁判
# CD = 大法官解釋
# T = 大法官不受理決議
# C = 司法解釋
# J2 = 大法庭專區
# J1 = 停止適用之判例
# J = 精選裁判
# D = 決議
# Q = 法律問題
# E = 行政函釋
get_legal_interpretation(ty="Q", doc_id="114,1234")
get_legal_interpretation(ty="D", doc_id="96,5678")範例問法
「查民法第 184 條」
「搜尋跟預售屋遲延交屋有關的最高法院判決」
「釋字 748 的理由書重點是什麼」
「哪些大法官解釋討論過集會自由」
「釋字 748 引用了哪些先前的釋字」
「查 111 年憲判字第 1 號」註冊到你的 Claude client
依你使用的 Claude client 選對應的段落。
Claude Code (CLI)
Claude Code 會自動載入專案根目錄的 .mcp.json。這個 repo 已經內建一份。
Linux / macOS 使用者(內建版本,無需修改):
{
"mcpServers": {
"taiwan-legal-db": {
"command": ".venv/bin/python",
"args": ["-m", "mcp_server.server"],
"cwd": "."
}
}
}Windows 使用者(需要修改 .mcp.json):
{
"mcpServers": {
"taiwan-legal-db": {
"command": ".venv\\Scripts\\python.exe",
"args": ["-m", "mcp_server.server"],
"cwd": "."
}
}
}零設定:cd 進 repo 之後跑 claude 就好。MCP server 列表會看到 taiwan-legal-db,而且此資料夾不會有其他多餘的 server。
跟隊友分享:.mcp.json 已經 commit 進 repo。任何人 clone 下來跟著 Quick Start 跑完,就會自動完成 MCP 註冊。
加到其他專案(你想在另一個資料夾用這個 MCP):用 claude mcp add 以 project scope 加入:
macOS / Linux:
cd /path/to/your/other/project
claude mcp add taiwan-legal-db --scope project --cwd "/absolute/path/to/mcp-taiwan-legal-db-integrated" -- \
"/absolute/path/to/mcp-taiwan-legal-db-integrated/.venv/bin/python" \
-m mcp_server.serverWindows(PowerShell):
cd C:\path\to\your\other\project
claude mcp add taiwan-legal-db --scope project --cwd "C:\path\to\mcp-taiwan-legal-db-integrated" -- `
"C:\path\to\mcp-taiwan-legal-db-integrated\.venv\Scripts\python.exe" `
-m mcp_server.server這會在你另一個專案的根目錄寫出一份 .mcp.json。想在每個專案都能用,把 --scope project 改成 --scope user。
Claude Desktop (macOS / Windows)
Claude Desktop 使用一個全域設定檔:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonWindows (Microsoft Store / WinGet / MSIX 安裝):
C:\Users\<YourName>\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json
最快開啟方式:在 Claude Desktop 點選單列(不是視窗)→ Settings → Developer → Edit Config。檔案若不存在 Claude Desktop 會自動建立。
在 mcpServers 下加入以下內容(跟已有內容合併):
macOS / Linux:
{
"mcpServers": {
"taiwan-legal-db": {
"command": "/absolute/path/to/mcp-taiwan-legal-db-integrated/.venv/bin/python",
"args": ["-m", "mcp_server.server"],
"cwd": "/absolute/path/to/mcp-taiwan-legal-db-integrated"
}
}
}Windows:
{
"mcpServers": {
"taiwan-legal-db": {
"command": "C:/Users/YourName/mcp-taiwan-legal-db-integrated/.venv/Scripts/python.exe",
"args": ["-m", "mcp_server.server"],
"cwd": "C:/Users/YourName/mcp-taiwan-legal-db-integrated"
}
}
}把路徑換成你的實際 clone 路徑。cwd 欄位建議設定(確保資料檔載入路徑正確)。Windows 路徑可用正斜線 / 或雙反斜線 \\。
存檔後,完全關閉並重新開啟 Claude Desktop(不是只關視窗 — macOS 用 ⌘Q、Windows 右鍵工具列圖示 → Quit)。設定檔只會在重啟時重新載入。
Claude Cowork (Pro 以上方案)
Claude Cowork 跑在 Claude Desktop 裡面,共用同一個 claude_desktop_config.json — 沒有另外的 Cowork 設定檔。任何你在 Claude Desktop 註冊的 MCP server 會自動透過 Claude Desktop SDK 橋接進 Cowork 的沙盒 VM。
設定步驟:
照上面 Claude Desktop 段落把
taiwan-legal-db加進claude_desktop_config.json完全關閉並重新開啟 Claude Desktop — 同時也會重啟 Cowork
開一個 Cowork session,
taiwan-legal-db的工具就可以用了
注意:Cowork 目前在 Claude Pro / Max / Team / Enterprise 方案都可以用,且只能存取你明確授權的資料夾。MCP server 本身跑在你的 host 上(不是 Cowork VM 裡面),透過 Desktop SDK bridge 溝通,所以不管你授權哪個資料夾給 Cowork,它都存取得到內建的資料檔。
其他 MCP 相容 client
任何符合 Model Context Protocol 規範 的 MCP client 都可以使用這個 server。啟動指令永遠是:
.venv/bin/python -m mcp_server.serverWindows:
.venv\Scripts\python.exe -m mcp_server.server⋯⋯加上 cwd 設定為 repo 根目錄(Python 才找得到 mcp_server 套件)。設定位置請參考你使用的 client 的文件,找 mcpServers JSON 區塊寫在哪裡。
疑難排解
備注:以下指令為 Linux / macOS 格式。Windows 使用者請將
.venv/bin/替換為.venv\Scripts\。
ModuleNotFoundError: No module named 'mcp_server'
→ 你沒有在 venv 裡面跑 pip install -e .。回到 Quick Start 步驟 2。
FileNotFoundError: data/pcode_all.json
→ 內建的 mcp_server/data/pcode_all.json 不見或被刪了。用 git checkout mcp_server/data/pcode_all.json 還原,或觸發重新下載:
.venv/bin/python -m mcp_server.updaterMCP client 回報「伺服器啟動失敗」 → 直接跑 Quick Start 步驟 3 的驗證指令。若失敗,代表 import chain 壞了 — 看 traceback。若通過,問題在 MCP client 的啟動設定(路徑或 cwd 錯了)。
ssl.SSLCertVerificationError: ... Missing Subject Key Identifier
→ 這是 OpenSSL 3.6+ 對 TWCA Global Root CA 的廣泛 rejection,不是 certifi 舊的問題。本 repo 透過 truststore 套件讓 Python 改用作業系統原生的 trust store(macOS Security framework、Windows CryptoAPI、Linux 系統 CA),所有路徑都保留完整 SSL 驗證(verify=True),不使用 verify=False。這在 macOS、Windows 以及 OpenSSL <3.6 的 Linux 都能正常工作。OpenSSL 3.6+ 的 Linux 環境(Fedora 40+、未來的 Ubuntu LTS)目前可能仍有問題,歡迎 issue 回報。
WAF 處理機制
司法院 judgment.judicial.gov.tw 部署了 F5 BIG-IP ASM WAF,純 HTTP 請求可能被擋(回固定 245 bytes 的 "Request Rejected")。
本專案採混合策略:
預設用 httpx 直接請求(~0.25s)
偵測到被擋(response 含
Request Rejected或 JS challenge markerbobcmn/TSPD)自動 fallback 到 Playwright 跑一次 JS challenge取得 TSPD cookies 後持久化到
mcp_server/data/.judicial_cookies.json(0600 權限,已 gitignore)後續查詢繼續用 httpx 帶 cookies 執行
cons.judicial.gov.tw(釋字)跟 law.moj.gov.tw(法規)沒這個問題,不經過 WAF 流程。
資料來源與統計
所有資料都取自台灣政府公開資料庫。不會對外做其他網路呼叫:
來源 | 網域 | 說明 |
司法院裁判書系統 | judgment.judicial.gov.tw | 裁判書搜尋與全文(含簡易案件系統) |
司法院法令判解系統 | legal.judicial.gov.tw | 大法官解釋、決議、法律問題、精選裁判、行政函釋 |
司法院憲法法庭 | cons.judicial.gov.tw | 大法官解釋與憲判字(離線快取) |
全國法規資料庫 | law.moj.gov.tw | 法規條文與修法沿革 |
mcp_server/config.py:ALLOWED_DOMAINS 以硬編碼 allow-list 強制執行。伺服器會拒絕抓取任何不在這些網域的 URL。
憲法法庭資料統計
資料集 | 筆數 | 含理由書 | 含意見書 | 檔案大小 |
舊制釋字(old_cases.json) | 813 | 734 | 370 | 7.4 MB |
新制憲判字(new_cases.json) | 55 | 55 | 55 | 1.8 MB |
快取
資料類型 | TTL | 位置 |
判決全文 | 30 天 |
|
搜尋結果 | 24 小時 | 同上 |
法規條文 | 7 天 | 同上 |
pcode metadata | 30 天 | 同上 |
釋字/憲判字 | 本地 JSON(不過期) |
|
全部清除:刪掉 mcp_server/data/cache/legal_mcp.db。快取檔在 .gitignore 內。
🔄 自動更新(整合版三層機制)
整合版內建三層自動更新,全部在伺服器啟動時於背景執行,失敗只記 warning、絕不阻擋啟動與查詢:
層 | 內容 | 頻率 | 模組 |
法規清單 |
| 每週六 06:00 後首次啟動 |
|
工程會函釋 |
| 每 7 天 |
|
程式碼 | 檢查 GitHub main 分支新 commit,下載並覆蓋程式碼(本地資料一律保留),下次重啟生效 | 每日最多一次 |
|
手動更新:
.venv/bin/python -m mcp_server.updater # 法規清單
.venv/bin/python -m mcp_server.pcc_updater # 工程會函釋(增量)
.venv/bin/python -m mcp_server.pcc_updater --full # 工程會函釋(全量補抓)
.venv/bin/python -m mcp_server.self_update --force # 程式碼環境變數:
TWLEGAL_SELF_UPDATE=0— 停用程式碼自我更新TWLEGAL_REPO=owner/name— 改追蹤其他 GitHub repo(預設本倉庫)
專案結構
mcp-taiwan-legal-db-integrated/
├── .gitignore
├── .mcp.json # 資料夾內 Claude Code session 自動註冊用
├── LICENSE # MIT(程式碼)
├── DATA_LICENSE # CC0 1.0(憲法法庭資料)
├── SOURCES.md # 資料來源說明
├── CITATION.cff # 學術引用格式
├── README.md # 本檔(繁體中文)
├── README.en.md # English version
├── pyproject.toml # 套件 metadata 與相依
├── scripts/ # 🏗️ 工程會函釋全量重建工具(一般使用不需要)
│ ├── pcc_console_crawler.js # 瀏覽器 Console 抓取(零安裝)
│ ├── crawler.py # Python 版全量爬蟲
│ ├── build_db.py # JSON → pcc_letters.db
│ └── schema.sql # 資料表結構
└── mcp_server/
├── __init__.py
├── server.py # FastMCP 入口 — 定義 13 個 @mcp.tool() function
├── config.py # URL、法院代碼、快取 TTL、allowed domains
├── updater.py # pcode_all.json 更新(每週六自動)
├── pcc_updater.py # 🏗️ 工程會函釋增量更新(每 7 天自動)
├── self_update.py # 🏗️ 程式碼自我更新(每日檢查 GitHub)
├── cache/db.py # SQLite 快取層
├── data/
│ ├── pcode_all.json # 11,700+ 部法規(內建,~780 KB)
│ ├── law_histories.json # 修法沿革(內建,~9.6 MB)
│ ├── old_cases.json # 813 筆舊制釋字全文(內建,~7.4 MB)
│ ├── new_cases.json # 55 筆新制憲判字全文(內建,~1.8 MB)
│ └── pcc_letters.db # 🏗️ 3,600+ 則工程會函釋(內建,~10 MB)
├── models/ # Judgment / Regulation dataclass
├── parsers/ # 判決與法規頁面的 HTML parser
├── tools/
│ ├── judicial_search.py # search_judgments
│ ├── judicial_doc.py # get_judgment
│ ├── lawsearch.py # search_legal_interpretations, search_legal_interpretations_advanced, get_legal_interpretation
│ ├── regulations.py # query_regulation, get_pcode, search_regulations
│ ├── constitutional_court.py # get_interpretation, search_interpretations, get_citations
│ └── pcc_letters.py # 🏗️ search_pcc_letters, get_pcc_letter
└── tests/ # pytest 測試執行測試
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest mcp_server/tests/ -v關於
原專案
原專案為 lawchat-oss/mcp-taiwan-legal-db。
原作者:LawChat
原專案提供了台灣法律資料查詢功能,包括:
司法院裁判書系統查詢
全國法規資料庫查詢
憲法法庭大法官解釋查詢
WAF 處理機制
離線快取設計
本專案(整合版本)
本整合版本以增補版為基礎,包含其全部增補功能:
🌟 簡易案件系統查詢:支援地方法院簡易案件與小額案件查詢 🌟 法令判解系統查詢:支援查詢大法官解釋、決議、法律問題、精選裁判、行政函釋等 🌟 裁判書進階搜尋:分頁機制、系統選擇、件數統計等功能
並再整合下列功能:
🏗️ 工程會函釋查詢:行政院公共工程委員會「政府採購法規解釋函令」本地快取查詢 🔄 三層自動更新:法規清單、工程會函釋、程式碼本身
維護資訊:
回報問題:GitHub Issues
重要聲明:
本增補版本由社群開發者個人維護,與原專案作者及維護者無關
增補功能的品質、錯誤或問題,均與原專案作者無涉
使用者如有疑問或建議,請於增補版倉庫提出 issue
授權
程式碼:MIT License
憲法法庭資料:CC0 1.0(公有領域貢獻)— 任何人皆可自由使用、修改及散布,無需取得授權或署名。學術引用格式請參考 CITATION.cff。
裁判書與法規資料來源:司法院、法務部(政府公開資料)。 憲法法庭資料來源:司法院憲法法庭(依中華民國著作權法第 9 條屬公有領域)。詳見 SOURCES.md。
免責聲明
一般免責聲明(繼承自原專案)
This is an unofficial tool for querying publicly-available Taiwan legal databases. It is not affiliated with, endorsed by, or authorized by the Judicial Yuan, the Ministry of Justice, or any Taiwan government agency.
The data returned by this tool reflects the state of the upstream official sources at the time of query. It may be cached (see TTLs above), and must not be treated as legal advice or a substitute for the authoritative official sources. Always verify against the original sources before relying on the data for any legal or official purpose.
本工具為非官方的台灣公開法規資料查詢工具,與司法院、法務部或任何台灣政府機關無隸屬關係。查詢結果以上游官方資料庫當下狀態為準(且可能被快取 — 見上方 TTL 表),不得作為法律意見或正式用途依據,使用前請向官方資料庫驗證。
關於此增補版本
本專案為 lawchat-oss/mcp-taiwan-legal-db 的增補版本,專案架構完全沿用原作者設計,僅針對個人使用需求增補功能。
增補版本的責任歸屬:
增補功能(法令判解系統查詢、裁判書進階搜尋、分頁機制等)由社群開發者個人維護
增補功能的品質、錯誤、問題,均與原專案作者及維護者無關
原專案的功能與設計歸屬於原作者
使用者應自行評估工具的適用性,並對使用本工具所做出的任何決策負完全責任
任何基於本工具建構的應用程式、服務或衍生作品,須自行負責其行為、輸出正確性與對使用者的聲明
Available Tools
13 toolsget_citationsA
從大法官解釋/憲判字的理由書中抽取所有引用的其他釋字/憲判字字號。
追溯方向:查詢指定裁判引用了哪些先前裁判(往前追溯)。
Args: case_id: 解釋/裁判字號字串(格式同 get_interpretation) include_context: 每個引用附上原文前後 80 字片段
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | Yes | ||
| include_context | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses that it extracts citations and optionally attaches context snippets. However, it does not mention any behavioral traits like whether it requires authentication, rate limits, or performance characteristics. Basic transparency is present but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is relatively concise, using a single paragraph with clear bullet points for arguments. It could be slightly more structured, but every sentence adds information. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, the description adequately explains input and what is returned (citations with optional context). It lacks mention of return format or pagination, but for a simple extraction tool, it is reasonably complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must add meaning. It does: it explains that case_id should follow the same format as get_interpretation, and includes that include_context controls whether a snippet of 80 characters is attached. This adds value beyond the bare schema types.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool extracts all cited interpretation/case numbers from reasoning documents of Grand Justice interpretations. It specifies the trace direction as backward tracing (which prior judgments a given judgment cites), which distinguishes it from sibling tools like get_interpretation that retrieve a single interpretation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage: when you need to know which previous interpretations a specific case cites. It does not explicitly mention when not to use or name alternatives, but the context of sibling tools makes the use case clear. Slight lack of explicit guidance on exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_interpretationA
取得司法院大法官解釋(釋字第 1-813 號)或憲法法庭裁判(憲判字)全文。
預設層(字號/日期/爭點/解釋文)從本地快取即時回傳,無需連網。 理由書/意見書支援全文模式與關鍵字片段模式。
case_id 格式(自動解析):「釋字第748號」「釋字748」「748」 「111年憲判字第1號」「111憲判1」
Args: case_id: 解釋/裁判字號字串 include_reasoning: 回傳理由書全文(最多 15000 字) reasoning_keyword: 在理由書中搜尋關鍵字並回片段(覆蓋 include_reasoning) include_opinions: 回傳意見書全文 opinions_keyword: 在意見書中搜尋關鍵字並回片段
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | Yes | ||
| include_reasoning | No | ||
| reasoning_keyword | No | ||
| include_opinions | No | ||
| opinions_keyword | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description discloses key behaviors: default fields from local cache (fast), reasoning/opinions have full-text and keyword modes, and reasoning_keyword overrides include_reasoning. It also mentions a 15000-character limit. However, it does not explicitly state whether reasoning/opinions require network access.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with sections for default mode, reasoning/opinions, case_id format, and parameter details. While somewhat verbose, every sentence adds value. Minor redundancy could be trimmed, but overall efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (5 parameters, no output schema), the description covers essential aspects: parameter behavior, caching, and case_id format. It lacks explicit output format details, but the tool's purpose implies returning the interpretation text. Generally sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant meaning beyond the input schema: it explains case_id formats (multiple accepted variants), the override behavior of reasoning_keyword and opinions_keyword, and the character limit for include_reasoning. With 0% schema coverage, this is essential and well-done.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves full text of judicial interpretations or constitutional court decisions, specifying the range (釋字第1-813號 or 憲法法庭裁判) and caching behavior. It distinguishes from sibling tools like search_interpretations, which imply search functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use the tool (retrieve specific known decisions) and provides formatting examples for case_id. However, it does not explicitly contrast with sibling tools like search_interpretations for when a search would be more appropriate, leaving some ambiguity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_judgmentA
取得單一裁判書全文。
支援兩種查詢方式:
以 JID 查詢(優先使用 Open Data API)
以 URL 查詢(直接載入頁面)
Args: jid: 裁判書 JID(如「TPSV,104,台上,472,20150326,1」),從搜尋結果取得 url: 裁判書 URL(如 https://judgment.judicial.gov.tw/FJUD/printData.aspx?id=...)
Returns: 包含裁判書全文的字典:case_id, court, date, main_text, facts, reasoning, cited_statutes, cited_cases, full_text, source_url
| Name | Required | Description | Default |
|---|---|---|---|
| jid | No | ||
| url | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses the two query methods, preference for Open Data API with JID, and return structure. Lacks error handling or potential issues, but sufficient for a read-only fetch.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with Args and Returns, but the return list is somewhat verbose. It is front-loaded with the main purpose, and each part is useful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description provides the full return structure. It covers both query methods adequately for a single document fetch tool. No missing critical info.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description provides detailed parameter descriptions with examples (jid format, url example), adding significant meaning beyond the schema defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it gets the full text of a single judgment (specific verb+resource). It distinguishes from siblings like search_judgments (searching) and get_citations (related items).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use the tool (to get a single judgment by JID or URL). It does not explicitly state when not to use it or mention alternatives, but the context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_legal_interpretationA
取得司法院法令判解系統單筆全文。
從 search_legal_interpretations 結果的 ty 和 id 欄位帶入。
ty 代碼對應: JCC=憲法法庭裁判、CD=大法官解釋、T=大法官不受理決議、C=司法解釋、 J2=大法庭專區、J1=停止適用之判例、J=精選裁判、D=決議、Q=法律問題、E=行政函釋
Args: ty: 資料類型代碼(從 search_legal_interpretations 結果取得) doc_id: 文件 ID(從 search_legal_interpretations 結果取得)
Returns: {success, ty, id, doc_type, title, full_text, url, cached, timestamp}
| Name | Required | Description | Default |
|---|---|---|---|
| ty | Yes | ||
| doc_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description discloses the return structure (success, ty, id, doc_type, title, full_text, url, cached, timestamp) and explains ty codes. It indicates a read operation and does not hide any behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear first sentence, a usage instruction, a formatted code mapping, and explicit Args/Returns sections. No extra words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple retrieval tool with two parameters and no output schema, the description covers purpose, usage context, parameter meaning, and return fields. It is fully sufficient for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, so the description fully compensates by explaining that ty and doc_id come from search results and providing a complete translation table for ty codes.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states '取得司法院法令判解系統單筆全文' (Get a single full text from the Judicial Yuan law interpretation system), clearly indicating the tool's function as a retrieval tool for a single item. It also specifies the prerequisite of using search_legal_interpretations, distinguishing its purpose from sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly instructs to use parameters from search_legal_interpretations results, providing explicit when-to-use context. It also includes a mapping of ty codes, but does not explicitly contrast with sibling tools or say when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_pcc_letterA
取得單一工程會函釋全文(主旨、說明全文、法規、條號、發文日期、現行有效狀態、來源)。
letter_id 與 letter_no(發文字號)擇一提供。若 status 為 superseded/partial, 務必改引取代函釋或標註已停止適用,勿直接援用。
Args: letter_id: 函釋 ID(從 search_pcc_letters 結果取得) letter_no: 發文字號模糊比對(例:工程企字第11500052701號)
Returns: {success, letter_id, letter_no, law_name, based_on, articles, subject, full_text, issuer, issue_date_roc, issue_date, status, superseded_by, status_note, source_url, fetched_at}
| Name | Required | Description | Default |
|---|---|---|---|
| letter_id | No | ||
| letter_no | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It describes return fields and advises on handling superseded status, implying a read-only operation. However, it does not explicitly state read-only nature or any side effects, but the 'get' verb makes it clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with no wasted sentences. It front-loads the purpose, immediately provides usage rules, then details parameters and return fields in a structured manner.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple retrieval tool with no output schema, the description lists all expected return fields (22 items) and includes behavioral advice on handling results. This fully equips the agent to use and interpret the output correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage (only titles). The description compensates fully: explains letter_id is from search_pcc_letters results, and letter_no is a fuzzy match with an example. This adds critical meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves full text of a single PCC letter, including specific fields. This distinguishes it from sibling tools like search_pcc_letters (search) and other get_* tools for different document types.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states that letter_id and letter_no are alternatives (擇一提供), and provides a crucial usage condition: if status is superseded/partial, do not directly cite but instead refer to the superseding letter or mark as obsolete. This is high-quality guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_pcodeA
將法規名稱轉換為全國法規資料庫的 pcode 代碼。
涵蓋 11,700+ 部法規(法律 + 命令),支援模糊比對。
Args: law_name: 法規名稱(如「民法」「勞基法」「消保法」)
Returns: 包含 pcode 的字典,或模糊比對建議
| Name | Required | Description | Default |
|---|---|---|---|
| law_name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description discloses important behaviors: covering 11,700+ regulations, supporting fuzzy matching, and returning a dictionary with pcode or suggestions. It lacks details on error handling or rate limits but is adequate for a simple lookup tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two clear paragraphs, front-loading the purpose and providing Args/Returns sections. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool with no output schema, the description covers purpose, input, output format, and key behaviors like fuzzy matching and coverage, making it fully self-contained.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only provides the parameter name and type with 0% coverage. The description adds meaning by explaining law_name as a Chinese regulation name with examples (e.g., 民法, 勞基法), which goes beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: converting law names to pcode codes for the national law database. It is distinct from sibling tools like get_citations or get_interpretation, which serve different retrieval functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for converting law names to pcode, providing context of coverage and fuzzy matching. However, it does not explicitly state when to use this tool versus alternatives or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_regulationA
查詢全國法規資料庫的法規條文。
可查詢單一條文、條號範圍、或法規全文。
Args: law_name: 法規名稱(如「民法」「勞動基準法」),會自動轉換為 pcode pcode: 法規代碼(如「B0000001」),若提供 law_name 可不填 article_no: 條號(如「184」「247-1」「15-1」),查詢單一條文 from_no: 起始條號(如「184」),查詢條號範圍時使用 to_no: 截止條號(如「198」),查詢條號範圍時使用 include_history: 是否包含修法沿革(使用者詢問修法歷程、修正時間、歷次修正內容時設為 True)
Returns: 包含法規條文的字典:law (pcode, name, status), articles, source_url, history(選填)
| Name | Required | Description | Default |
|---|---|---|---|
| law_name | No | ||
| pcode | No | ||
| article_no | No | ||
| from_no | No | ||
| to_no | No | ||
| include_history | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description fully addresses behavioral aspects. It discloses automatic law_name-to-pcode conversion, the return structure (law, articles, source_url, optional history), and the functional scope. No destructive behavior is expected, and the transparency is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement and bullet-style parameter explanations. It is slightly verbose but every part contributes to understanding. Concise enough for an AI agent to parse efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 6 parameters, 0% schema coverage, and no output schema, the description covers all parameters and return structure. It could mention error handling or prerequisites (e.g., either law_name or pcode required), but it is largely complete for the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description compensates fully. It explains each parameter's purpose (e.g., law_name vs pcode, article_no for single article, from_no/to_no for range, include_history for history) with examples like '民法' and '247-1'. This adds significant meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it queries the national regulations database, specifying the types of queries (single article, range, full text). This distinguishes it from siblings like search_regulations, which likely searches across regulations rather than retrieving specific articles.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains parameter usage (e.g., include_history for history queries) but does not explicitly guide when to use this tool versus alternatives like search_regulations or get_citations. Usage context is implied but lacks exclusions or alternative recommendations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_interpretationsA
列舉大法官解釋 / 憲法法庭裁判。支援關鍵字全文搜尋(搜爭點 + 理由書)。
每筆結果帶 case_id,可直接傳給 get_interpretation()。
Args: keyword: 關鍵字(標題/字號/爭點/理由書全文匹配) year: 篩選民國年度(0=不篩選,>0 只回新制憲判字) number_from: 起始號次(含),0=不篩選 number_to: 截止號次(含),0=不篩選 include_old: 包含舊制釋字(year=0 時才生效) include_new: 包含新制憲判字 max_results: 回傳筆數上限(預設 30)
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | ||
| year | No | ||
| number_from | No | ||
| number_to | No | ||
| include_old | No | ||
| include_new | No | ||
| max_results | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries full burden. It discloses that keyword search covers '爭點 + 理由書', and explains parameter behaviors (e.g., year=0 applies to old system). However, it does not mention side effects, authentication, rate limits, or explicitly state read-only nature, which is acceptable for a search tool but leaves some ambiguity.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a short introductory sentence followed by a parameter list. It is slightly verbose due to parameter explanations, but every sentence adds value. Could be more concise by integrating parameter notes into a single paragraph.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 7 parameters and no output schema. The description explains parameters well but lacks details on return format (e.g., fields beyond case_id, pagination, sorting). It assumes output structure without specifying, leaving some gaps for an agent to infer.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% parameter description coverage, so the description fully compensates by explaining each of the 7 parameters with conditions (e.g., 'include_old only effective when year=0'). This adds essential meaning beyond the schema's default values and titles.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool enumerates (列舉) interpretations/constitutional court decisions and supports full-text keyword search across issues and reasoning. It specifies the resource (大法官解釋/憲法法庭裁判) and action (搜尋), distinguishing it from sibling 'get' tools like get_interpretation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains that results include 'case_id' for direct use with get_interpretation(), and details each parameter's effect (e.g., year filtering, max_results). It does not explicitly state when not to use or alternative tools, but the context of siblings implies appropriate usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_judgmentsA
搜尋司法院裁判書系統。
結果自動按法院權威性排序(最高法院→高等法院→地方法院),同層級按原始排序。 每筆結果含 court(法院名稱)、case_type(民事/刑事/行政)、court_level(1=最高/2=高等/3=地方)。
【重要】查特定案號時,必須用 case_word + case_number(精確查詢),不要把案號放在 keyword。 所有案件類型(包含一般案件、簡易案件、小額案件)都使用相同方式查詢,系統會自動同時查詢裁判書系統與簡易案件系統。 例如查「114年度上易字第503號」→ case_word="上易", case_number="503"(不傳year_from/year_to)。 例如查「114年度羅小字第412號」→ case_word="羅小", case_number="412"(不傳year_from/year_to)。 例如查「114年度北簡字第100號」→ case_word="北簡", case_number="100"(不傳year_from/year_to)。 注意:案號年度與裁判日期年度可能不同,查精確案號時不傳年度可避免遺漏。 keyword 僅用於主題式全文檢索(如「預售屋 遲延交屋」),不可用於查詢特定案號。
【裁判書系統 vs 簡易案件系統】: 本工具可查詢兩個系統:
裁判書系統(通常系統)- 完整判決,支援所有參數過濾
簡易案件系統 - 地方法院簡易/小額案件,但有以下限制: ❌ 不支援 court 參數過濾(無法指定特定地方法院) ❌ 不支援 case_type 參數過濾(無法指定民事/刑事) ✅ 支援 keyword、main_text、case_word、case_number、year 等參數
【search_system 參數說明】:
"auto"(預設)- 智能判斷:
指定非地方法院(高等/最高/智財/懲戒) → 只查裁判書系統
指定地方法院 → 查詢兩個系統(⚠️ 簡易系統會混入其他地院案件)
未指定法院 → 查詢兩個系統
"both" - 強制查詢兩個系統(即使指定了 court/case_type)
"regular" - 只查裁判書系統(不含簡易案件)
"easy" - 只查簡易系統(僅地方法院簡易/小額案件)
【指定地方法院時的注意事項】⚠️: 當指定地方法院(如「臺灣臺東地方法院」)且 search_system="auto" 或 "both" 時:
裁判書系統:正確過濾,只回傳該地院判決 ✅
簡易系統:無法過濾,會混入全國所有地院的簡易案件 ❌
解決方法:在 keyword 中加入法院名稱進行二次過濾 範例:查臺東地院的侵權行為案件 → keyword="侵權行為 臺灣臺東地方法院", court="臺灣臺東地方法院" → 簡易系統雖會查到其他地院,但因缺少「臺灣臺東地方法院」關鍵字而被排除
或者使用 search_system="regular" 只查裁判書系統(不含簡易案件)
【進階實務研究欄位】:
main_text: 裁判主文關鍵字 — 最有效的輸贏方篩選方式。 主文措辭高度制度化(依民刑訴訟法條生成),substring match 接近 解析半結構化欄位,精度高:
「被告應將 移轉」→ 被告敗訴(物權移轉類)
「被告應給付」→ 被告敗訴(金錢給付類)
「原告之訴駁回」→ 原告敗訴
「上訴駁回」→ 維持原審 支援布林運算:+(或)、-(不含)、&(且)、()(組合)
「被告應給付&損害賠償」→ 主文同時包含兩者
「原告之訴駁回+上訴駁回」→ 主文包含任一種 可與 keyword 併用,例: 找「借名登記成立、被告敗訴」→ main_text="被告應將 移轉", keyword="借名登記", case_type="民事"
【分頁機制】: 本工具每次最多回傳 max_results 筆(上限 200),但實際總筆數可能遠超過 200 筆。 回傳結果中的 total_count 欄位顯示真實總筆數(從司法院網頁解析)。
當 total_count > 回傳筆數時,表示還有更多結果: 使用 offset 參數可取得後續結果,例如:
第 1-200 筆:max_results=200, offset=0
第 201-400 筆:max_results=200, offset=200
第 401-600 筆:max_results=200, offset=400
建議:先用小 max_results 測試,確認 total_count 後再用多次呼叫取得完整結果。
【系統別件數資訊】: 查詢結果中會包含 regular_count(裁判書系統件數)和 easy_count(簡易系統件數)。
當件數很多時,建議分系統查詢:
使用 search_system="regular" 查詢裁判書系統
使用 search_system="easy" 查詢簡易系統
可以更精確控制分頁,避免重複抓取資料
司法院 500 筆限制: 每個系統各有 500 筆上限,如某系統超過 500 筆,第 501 筆之後無法取得。 解決方案:(1) 按時間拆分(年度、月份、日期)(2) 按法院拆分
Args: keyword: 全文檢索關鍵字(對應 jud_kw)。支援布林運算:+(或)、-(不含)、&(且)、()(組合),例如「不完全給付&瑕疵擔保」、「民法-刑法」 court: 法院名稱(如「最高法院」「臺灣高等法院」「臺灣臺北地方法院」) case_type: 案件類型(民事/刑事/行政/懲戒) year_from: 起始年度(民國年,如 110),關鍵字搜尋時使用,查精確案號時不填 year_to: 截止年度(民國年,如 113),關鍵字搜尋時使用,查精確案號時不填 case_word: 字別(如「台上」「上易」「重訴」「羅小」「北簡」),查特定案號時必填 case_number: 案號(數字),查特定案號時必填 main_text: 裁判主文關鍵字(對應 jud_jmain)— 結構化篩選輸贏方。支援布林運算:+(或)、-(不含)、&(且)、()(組合) max_results: 回傳筆數上限(預設 10,上限 200) offset: 跳過前幾筆(分頁用,預設 0) search_system: 查詢系統選擇("auto"=智能判斷, "both"=兩者, "regular"=僅裁判書, "easy"=僅簡易),預設 "auto"
Returns: 包含搜尋結果的字典:success, query, total_count, results, cached, timestamp
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | ||
| court | No | ||
| case_type | No | ||
| year_from | No | ||
| year_to | No | ||
| case_word | No | ||
| case_number | No | ||
| main_text | No | ||
| max_results | No | ||
| offset | No | ||
| search_system | No | auto |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations were provided, so the description carries the full burden. It thoroughly discloses behavior: result sorting by court authority, fields returned (court, case_type, court_level), the dual-system behavior with limitations, pagination mechanics, the 500-record limit per system, and the meaning of total_count. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with headings and sections (【重要】, 【裁判書系統 vs 簡易案件系統】, Args, Returns). Some repetition (e.g., pagination explained twice) could be trimmed, but overall it is logically organized and front-loaded with key warnings.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (11 parameters, no schema descriptions, no output schema, no annotations), the description is remarkably complete. It covers dual systems with cross-system interactions, pagination, the 500-record limit, total_count, result fields, and examples. It even explains the rationales (e.g., why not to pass year parameters for specific case numbers). No gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description must explain all parameters exhaustively. It does: keyword supports Boolean operators, court is a free-text court name, case_type has allowed values, year_from/to are Republican years, case_word/case_number for exact case search, main_text with examples and Boolean logic, max_results/offset for pagination, and search_system with four modes explained. Every parameter is covered.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states '搜尋司法院裁判書系統' (search the Judicial Yuan judgment system), clearly indicating the verb (search) and resource (court judgments). It distinguishes from sibling tools like get_judgment (single retrieval) and other search tools by its focus on multi-result judgment search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides extensive usage guidance: when to use keyword vs case_word+case_number, how to handle specific case numbers, the limitations of the easy system, and explicit examples. It also advises on pagination and splitting queries across systems, making it clear when to use alternative approaches.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_legal_interpretationsA
搜尋司法院法令判解系統(legal.judicial.gov.tw/FINT)。
可搜尋大法官解釋、憲法法庭裁判、決議、法律問題、精選裁判、行政函釋等。 與 get_interpretation / search_interpretations 的差異:
本工具查詢線上「法令判解系統」,支援全文關鍵字搜尋,可跨多個資料類型
get_interpretation 查詢的是離線快取的大法官解釋/憲判字
doc_type 可填以下中文名稱或留空(空白 = 全部類型): 憲法法庭裁判、大法官解釋、大法官不受理決議、司法解釋、 大法庭專區、停止適用之判例、精選裁判、決議、法律問題、行政函釋
分頁說明:每次最多回傳 max_results 筆,使用 offset 跳過前幾筆。 例如取第 21-40 筆:max_results=20, offset=20。
Args: keyword: 關鍵字(法院名稱、裁判案號、案由、全文檢索字詞)。支援布林運算:+(或)、-(不含)、&(且)、()(組合),例如「不完全給付&瑕疵擔保」 doc_type: 資料類型篩選,空白表示搜尋全部類型 max_results: 最多回傳筆數(預設 20,上限 200) offset: 跳過前幾筆(分頁用,預設 0)
Returns: {success, keyword, doc_type, categories(各類筆數), total_count, results, cached, timestamp} results 每筆含:doc_type, title, date, summary, ty, id, url
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | ||
| doc_type | No | ||
| max_results | No | ||
| offset | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description fully discloses behavior: it is a search tool returning results with specific structure, lists supported doc types, and explains query syntax and pagination. No destructive actions hidden.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with clear sections (intro, differences, doc_type list, pagination example, args, returns). Slightly lengthy but all content is useful; could be trimmed without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Complete coverage: source website, query syntax, all parameter details, pagination, return format (fields). No output schema exists, but description fills that gap. Adequate for a complex search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description provides comprehensive meaning for all parameters: keyword with boolean operators, doc_type with valid values and default, max_results with default and max, offset with pagination use.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it searches a specific online legal database and enumerates the types of documents it can retrieve. Explicitly differentiates from get_interpretation and search_interpretations by describing scope and source.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to use this tool versus siblings: it is for online full-text search across multiple document types, while get_interpretation is for offline cache. Also explains pagination with example.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_legal_interpretations_advancedA
進階搜尋司法院法令判解系統,支援日期範圍篩選和文件類型過濾。
核心機制說明
本工具採用「兩階段查詢」設計:
第一階段:送出查詢條件(日期、關鍵字),取得 categories 統計
第二階段:根據 categories 的類型名稱,精確篩選結果
重要:categories 中的 "name" 欄位值,可以直接用於 doc_types 參數!
推薦工作流程(兩次查詢)
第一次查詢(探索):
search_legal_interpretations_advanced(
date_from="114/1/1",
date_to="114/12/31",
doc_types=None # 不指定類型
)
回傳:
categories: [
{"ty": "Q", "name": "法律問題", "count": 80},
{"ty": "D", "name": "決議", "count": 0},
{"ty": "J", "name": "精選裁判", "count": 197},
...
]第二次查詢(精確取得):
search_legal_interpretations_advanced(
date_from="114/1/1",
date_to="114/12/31",
doc_types=["法律問題"], # 直接使用 categories 的 name 值
max_results=100 # 調高上限以取得全部 80 筆
)
回傳:
全部 80 筆「法律問題」類型的結果使用範例
範例 1:查詢 96 年所有決議
# 步驟 1:先查看有多少筆
result1 = search_legal_interpretations_advanced(
date_from="96/1/1", date_to="96/12/31"
)
# categories 顯示:{"ty": "D", "name": "決議", "count": 20}
# 步驟 2:取得全部 20 筆決議
result2 = search_legal_interpretations_advanced(
date_from="96/1/1",
date_to="96/12/31",
doc_types=["決議"], # 使用 categories 的 name
max_results=50
)範例 2:查詢 114 年高院法律座談會 (注意:法律座談會在「法律問題」類別,不在「決議」類別)
# 步驟 1:查看 114 年有哪些類型
result1 = search_legal_interpretations_advanced(
date_from="114/1/1", date_to="114/12/31"
)
# categories 顯示:{"ty": "Q", "name": "法律問題", "count": 80}
# 步驟 2:取得全部 80 筆法律問題
result2 = search_legal_interpretations_advanced(
date_from="114/1/1",
date_to="114/12/31",
doc_types=["法律問題"],
max_results=100
)範例 3:查詢特定細分類型
# 只查民事決議(網站表單直接支援的細分類型)
result = search_legal_interpretations_advanced(
date_from="96/1/1",
date_to="96/12/31",
doc_types=["民事決議"]
)文件類型選項說明
概括類型(對應 categories 的 name,使用後篩選機制):
"憲法法庭裁判", "大法官解釋", "大法官不受理決議", "司法解釋"
"大法庭專區", "停止適用之判例", "精選裁判", "決議", "法律問題", "行政函釋"
細分類型(網站表單直接支援,使用前篩選機制):
"民事決議", "刑事決議", "家事決議", "行政決議"
錯誤處理: 如果 doc_types 包含無效值,工具會報錯並列出所有有效選項。
參數說明
Args: keyword: 關鍵字(選填),可用於縮小搜尋範圍 date_from: 起始日期,格式:民國年/月/日(如 "114/1/1") date_to: 結束日期,格式:民國年/月/日(如 "114/12/31") doc_types: 文件類型列表(使用 categories 的 name 值或細分類型),None = 全部類型 max_results: 最多回傳筆數(預設 20,上限 200),建議第二次查詢時調高以取得全部結果 offset: 跳過前幾筆(分頁用,預設 0)
Returns: {success, query, categories(各類筆數), total_count, results, cached, timestamp}
categories 結構:[{"ty": "代碼", "name": "類型名稱", "count": 筆數}, ...]
results 每筆含:doc_type, title, date, summary, ty, id, url
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | ||
| date_from | No | ||
| date_to | No | ||
| doc_types | No | ||
| max_results | No | ||
| offset | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully explains the two-phase query design, categories mechanism, return values including cached status, and doc_types behavior. It lacks mention of rate limits or authentication but otherwise is transparent about tool behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with sections, bullet points, code examples, and parameter breakdown. It is front-loaded with core mechanism and workflow. Some repetition could be trimmed, but overall it is efficient for the complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all necessary aspects: purpose, detailed workflow, parameter explanations, return value structure, error handling, and examples. Given the tool's complexity and no output schema, it is complete and leaves no major gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite the input schema having 0% description coverage, the description includes a detailed 'Args' section explaining each parameter's format, defaults, and usage, especially doc_types mapping to categories and max_results limit of 200. This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it is an advanced search for a specific legal database with date range and document type filtering. It implies differentiation from siblings by being 'advanced' but does not explicitly contrast with similar tools like search_legal_interpretations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit two-phase workflow recommendations, explains when to use doc_types, gives examples of first and second queries, and covers error handling with invalid doc_types. This gives clear guidance on how to use the tool effectively.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_pcc_lettersA
搜尋行政院公共工程委員會「政府採購法規解釋函令及相關函文」(工程會函釋)。
供採購法疑義、釋疑案、章則或分層負責審查引用採購法(及其子法)函釋時查證。 查的是本地快取(離線、零延遲),伺服器啟動時每 7 天自動增量更新。 回摘要清單,取全文用 get_pcc_letter。法規不限政府採購法,亦含 「機關委託技術服務廠商評選及計費辦法」等子法,可用 law_name 篩。
Args: keyword: 主旨+說明全文關鍵字(例:機關首長、契約變更、開口契約) article_no: 採購法條號(例:22、63、101、22-1) law_name: 法規名稱關鍵字(例:政府採購法、評選及計費辦法) letter_no: 發文字號模糊比對(例:工程企字) date_from: 發文日期下限(西元 ISO,例:2020-01-01) date_to: 發文日期上限(西元 ISO) only_active: 只回現行有效(排除停止適用),預設 True max_results: 筆數上限(預設 20) offset: 分頁偏移
Returns: {success, total, returned, results:[{letter_id, letter_no, law_name, articles, subject, issue_date_roc, status}]}
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | ||
| article_no | No | ||
| law_name | No | ||
| letter_no | No | ||
| date_from | No | ||
| date_to | No | ||
| only_active | No | ||
| max_results | No | ||
| offset | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses key behaviors: local cache, zero latency, auto-updates every 7 days on server start, returns summary list. No annotations exist, so description carries burden. Does not mention potential staleness or permissions, but sufficient for a search tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Structured with clear sections: purpose, cache details, scope, then Args. Front-loaded with essential info. Slightly verbose but every sentence adds value given the number of parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 9 parameters, no output schema, and no annotations, the description is very complete. Explains return format, pagination, filtering options, and links to related tool. No gaps identified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description includes an Args section detailing all 9 parameters with examples and format hints (e.g., ISO dates, article_no like '22-1'). Adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it searches PCC letters (government procurement law interpretations). Uses specific verb '搜尋' and resource '工程會函釋'. Differentiates from siblings by mentioning local cache and linking to get_pcc_letter for full text.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Describes when to use: for procurement law interpretation queries and citation verification. Mentions scope includes sub-laws. Implicitly excludes full-text retrieval (use get_pcc_letter). Lacks explicit exclusions but provides strong context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_regulationsA
以關鍵字搜尋法規名稱。
在完整法規清單(11,700+ 部)中搜尋,回傳符合的法規名稱與 pcode。 結果按現行法規優先排序,每頁 50 筆。
Args: keyword: 搜尋關鍵字(如「勞動」「消費」「智慧財產」) offset: 分頁偏移(從第幾筆開始,預設 0) exclude_abolished: 排除已廢止法規(預設 False,已廢止法規仍可搜尋但標記狀態)
Returns: 符合關鍵字的法規列表
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | ||
| offset | No | ||
| exclude_abolished | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Explains sorting behavior, pagination, and exclude_abolished effect. Does not explicitly state read-only nature but implied by search functionality.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise overall, front-loaded with purpose. Some redundancy in explaining exclude_abolished both in overview and in the parameter list. Still efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers purpose, scope, parameters, return values, sorting, pagination. No output schema, but return description is adequate. Complete for a search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage; description adds meaning for all three parameters: keyword with examples, offset with default, exclude_abolished with behavior explanation. Significantly enhances schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states 'search regulation names by keyword', specifies scope (11,700+ regulations), and distinguishes from sibling tools that search other content like interpretations or judgments.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides context on when to use (search in full regulation list), sorting by active regulations first, pagination of 50 per page. Does not explicitly state alternatives but sibling tool names imply different content types.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Most tools have distinct purposes: get_interpretation vs get_legal_interpretation differentiate between local cache and online system; search_interpretations vs search_legal_interpretations target different scopes. However, some pairs (e.g., get_citations vs get_judgment's cited_cases field) could cause minor confusion.
Tools consistently use verb_noun pattern with underscores: get_* (7 tools) and search_* (5 tools). The single exception is query_regulation instead of search_regulation, breaking the pattern slightly.
13 tools cover a broad legal research domain (interpretations, judgments, regulations, PCC letters). The count is reasonable, though some tools like get_citations could potentially be merged into get_judgment.
The tool surface covers key workflows: searching and retrieving interpretations, judgments, regulations, and PCC letters. Missing are perhaps cross-referencing tools or trend analysis, but core legal research needs are met.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Taiwan legal research MCP: 判決書、全國法規、釋字/憲判與立法歷程查詢,12 個工具,回應均附官方出處 URL。
LawOracle — 20 legal AI tools: case law search, contracts, EU regulations, citation graph.
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
Taiwan legal research: court judgments, statutes, and interpretations. 台灣判決、法條、函釋、釋字搜尋。
1
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search and analyze legal documents from multiple jurisdictions including US federal and state law, case law, EU regulations, UK legislation, Canadian law, Congress bills, SEC filings, and FDA data through free government APIs.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, retrieve, and analyze South Korean legal documents including statutes, precedents, constitutional decisions, and administrative rulings via the Ministry of Government Legislation Open API. Provides 89 specialized tools with features like legal abbreviation auto-recognition, annex extraction, and complex research chain workflows.MIT
- AlicenseAqualityDmaintenanceProvides AI assistants with access to Taiwan's public legal data, including court judgments, regulations, and constitutional court interpretations, via 8 MCP tools.8179MIT
- AlicenseAqualityDmaintenanceEnables searching and retrieving Taiwan judicial judgments, including full-text search, document details, PDF download, and legal term lookup via MCP tools.4MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/oldbear-meme/mcp-taiwan-legal-db-integrated'
If you have feedback or need assistance with the MCP directory API, please join our Discord server