Install any skill in seconds. Free to start, no credit card required.
Get Started Free →When the user is building a tool-calling agent and gets stuck — "為什麼 LLM 不呼叫我的 tool", "我這 schema 哪裡寫壞", "tool 被呼叫但 args 不對", "ReAct loop 跑不停", "the LLM won't call my tool", "help me design a function schema", "debug this tool-use behavior". Walks them through a 4-branch diagnostic + 5-step schema design walkthrough, with references to bad/good schema A/B and SDK-diff cheatsheet. Do NOT use for: pure LangChain / LangGraph / CrewAI framework questions (route to Stage 4 frameworks), MCP server buil
.claude/skills/wenyuchiou-tool-calling-tutor/SKILL.md| Model | Eval pass | Runs |
|---|---|---|
| gemini-3.6-flash | 100% | 7 |
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 63% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 65% | 0% |
You are now in the tool-calling debugging context. The user is building an agent that calls functions / tools, and something isn't working. Your job is to walk them through diagnosis + fix, not to write code for them.
When the user mentions tool calling problems, first infer the route from an explicit symptom and briefly confirm it. Ask one multiple-choice question only when the symptom is not explicit:
arguments 不對(型別錯、缺欄位、值不合理)明確的症狀不用重問;確認你推定的 route 後直接繼續。每個 branch 走的 reference 不同。
先檢查這 3 項:
description 太籠統:寫的是「處理資料 / Convert a value / Search things」這種給人讀的 docstring,LLM 看不到「這個 tool 解什麼具體問題」。看 debug-flowchart.md Section A。怎麼修:把 description 從「做什麼」改寫成「何時用」。對照 schema-evolution.md 的 bad → good A/B。
先檢查這 3 項:
string:{"value": {"type": "string"}} LLM 不知道要傳 number。改成 {"type": "number"}。required:模型可能漏傳必填欄位。明列 "required": ["value", "unit"]。unit: string 讓 LLM 傳 "C" "Celsius" "celsius" 都有可能。改 "enum": ["celsius", "fahrenheit"]。對照 schema-evolution.md 的 4 個改進。
跑不停的 3 個典型原因:
messages——下輪 LLM 看不到自己上輪講過什麼、會無限重複tool message 沒帶 tool_call_id——LLM 無法配對哪個 result 對應哪個 call、可能重新發起 tool callmax_iter safety net——當 tool 結果寫得不好、LLM 會無限呼叫漏步(多步任務中間少一步)的原因:
to_percentage 應該寫「Convert a ratio (e.g., 0.31) into percentage. Call this LAST after dividing.」明示順序。對照可跑範例 → ReAct starter 跟 multi-step starter。
對任何新 tool,按這 5 步:
number / boolean / array / object,不要全 string。required 列必填欄位;模糊邊界用 enum 收斂;description 補欄位用途。{"error": "...", "retry_hint": "..."};非預期例外必須可見並寫入 log。重試由應用程式的有界 policy(次數與規則)決定,不由 LLM 決定。Fork template:直接 copy single-turn starter.py 或 multi-turn starter.py 的 TOOLS_SPEC + TOOL_IMPL 結構、改成你的 tool。
使用者可能在 Anthropic / OpenAI / Ollama 之間切換、SDK shape 不同。看 sdk-diff.md 的 3 行對照表。若 SDK 或 model 沒說明,問一次;接著以固定 fixture 確認目前 tool-calling 支援並作同條件比較。
每個 tool-calling 程式都應該有 mock-based test、不打真 API:
完整 mock pattern 對照 test.py。先把 test 跑通、再連真的 LLM。
這個 skill 不處理:
碰到這些情境、直接告訴使用者「這個 skill 處理 tool-use mechanics、你這個問題需要 Stage X、建議去看 ...」、不要硬吃下去。
TOOLS_SPEC。| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 19,289 | 12,757 | -34% | 1 | 1 | 0% | 2,399 | 3,560 | +48% | 0 | 0 | — |
case-05 | fail→pass | 18,356 | 9,529 | -48% | 1 | 1 | 0% | 3,245 | 2,997 | -8% | 0 | 0 | — |
case-01 | fail→fail | 20,083 | 16,507 | -18% | 1 | 1 | 0% | 2,390 | 4,209 | +76% | 0 | 0 | — |
case-02 | fail→fail | 17,436 | 16,479 | -5% | 1 | 1 | 0% | 2,207 | 4,171 | +89% | 0 | 0 | — |
case-03 | fail→pass | 21,757 | 16,053 | -26% | 1 | 1 | 0% | 2,615 | 4,254 | +63% | 0 | 0 | — |
case-04 | fail→pass | 20,565 | 9,494 | -54% | 1 | 1 | 0% | 3,007 | 2,890 | -4% | 0 | 0 | — |
case-06 | fail→pass | 25,434 | 12,435 | -51% | 1 | 1 | 0% | 3,782 | 3,205 | -15% | 0 | 0 | — |
case-07 | fail→pass | 16,943 | 16,415 | -3% | 1 | 1 | 0% | 2,279 | 3,761 | +65% | 0 | 0 | — |
case-08 | fail→pass | 17,545 | 16,206 | -8% | 1 | 1 | 0% | 2,025 | 4,043 | +100% | 0 | 0 | — |
case-09 | pass→pass | 14,209 | 13,507 | -5% | 1 | 1 | 0% | 1,763 | 3,626 | +106% | 0 | 0 | — |
case-10 | pass→pass | 17,290 | 17,745 | +3% | 1 | 1 | 0% | 2,398 | 4,580 | +91% | 0 | 0 | — |
case-16 | pass→pass | 39,142 | 6,857 | -82% | 1 | 1 | 0% | 1,482 | 3,606 | +143% | 0 | 0 | — |
case-11 | pass→pass | 11,870 | 17,002 | +43% | 1 | 1 | 0% | 2,031 | 4,236 | +109% | 0 | 0 | — |
case-12 | pass→pass | 13,117 | 18,981 | +45% | 1 | 1 | 0% | 2,344 | 4,457 | +90% | 0 | 0 | — |
case-13 | pass→pass | 17,459 | 14,364 | -18% | 1 | 1 | 0% | 2,069 | 4,455 | +115% | 0 | 0 | — |
case-14 | pass→pass | 21,835 | 16,436 | -25% | 1 | 1 | 0% | 3,242 | 4,341 | +34% | 0 | 0 | — |
case-15 | pass→pass | 14,097 | 8,630 | -39% | 1 | 1 | 0% | 1,565 | 3,569 | +128% | 0 | 0 | — |
case-17 | pass→pass | 9,518 | 6,977 | -27% | 1 | 1 | 0% | 1,764 | 3,423 | +94% | 0 | 0 | — |
case-18 | pass→pass | 17,530 | 12,682 | -28% | 1 | 1 | 0% | 2,844 | 4,259 | +50% | 0 | 0 | — |
case-19 | fail→pass | 15,641 | 3,903 | -75% | 1 | 1 | 0% | 1,265 | 2,870 | +127% | 0 | 0 | — |
case-20 | fail→pass | 17,471 | 14,136 | -19% | 1 | 1 | 0% | 3,186 | 3,768 | +18% | 0 | 0 | — |
case-21 | pass→pass | 14,149 | 13,708 | -3% | 1 | 1 | 0% | 2,560 | 3,611 | +41% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +36 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/9/2026 | +43% |
Other measured skills in the registry, with their headline benchmark lift.