/ 目錄 / 演練場 / langsmith-fetch-skill
● 社群 OthmanAdi ⚡ 即開即用

langsmith-fetch-skill

作者 OthmanAdi · OthmanAdi/langsmith-fetch-skill

Debug LangChain / LangGraph agents from your terminal — fetches LangSmith Studio traces into Claude Code and analyzes failures, latency, tool calls.

A focused observability skill. When you ask Claude to debug an agent, it runs langsmith-fetch against LangSmith Studio, pulls trace data, analyzes execution patterns, and surfaces failures, root causes, latency hotspots, and tool-call issues. Export sessions for later review.

為什麼要用

核心特性

即時演示

實際使用效果

langsmith-fetch-skill.replay ▶ 就緒
0/0

安裝

作者儲存庫 · Claude Skills 官方文件

使用場景

實戰用法: langsmith-fetch-skill

Diagnose a slow agent without opening LangSmith UI

👤 LangChain/LangGraph devs ⏱ ~20 min intermediate

何時使用: An agent that used to be snappy is now slow; you want root cause.

步驟
  1. Ask Claude to diagnose
    Why is my agent <name> slow? Pull the last 20 traces from LangSmith and find the hotspot.✓ 已複製
    → Skill fetches traces; reports latency by step
  2. Drill in
    Focus on trace <id> — break down tool-call times.✓ 已複製
    → Per-tool latency with the outlier called out

結果: A specific step to optimize, not a hunch.

注意事項
  • Optimizing the average when tail latency is the problem — Ask for p95/p99 specifically
搭配使用: filesystem

Root-cause an agent failure from a trace id

👤 Anyone running LangGraph in production ⏱ ~15 min intermediate

何時使用: A user reported an error; you have the trace id.

步驟
  1. Fetch + analyze
    Debug trace <id>. What was the immediate error, what's the root cause in the graph?✓ 已複製
    → Error step + upstream decision that led to it

結果: A fix targeting the actual decision point, not the symptom.

Find which node burns the most tokens

👤 Teams optimizing LLM spend ⏱ ~30 min intermediate

何時使用: Monthly review of agent spend.

步驟
  1. Aggregate token usage
    Across last 7 days' traces, rank graph nodes by total token usage.✓ 已複製
    → Ranked table with % share
  2. Propose tightening
    For the top 3, propose prompt-compression or model downgrade options.✓ 已複製
    → Targeted opt list

結果: Measurable spend reduction without chasing tiny savings.

組合

與其他 MCP 搭配,撬動十倍槓桿

langsmith-fetch-skill + filesystem

Save exports alongside the agent code for lineage

Export the debugging session to debugging/traces/<date>.json.✓ 已複製
langsmith-fetch-skill + github

Attach trace summary to a bug report

Summarize trace <id> and post as comment on GitHub issue #42.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
fetch_recent project, limit Broad diagnosis LangSmith quota
fetch_trace trace_id Deep dive on one run LangSmith quota
analyze_failures traces Post-fetch analysis 0
export_session traces Archive for later 0

成本與限制

運行它的成本

API 配額
LangSmith: depends on plan; Studio has generous quotas
每次呼叫 Token 數
Low — traces are structured
費用
Free skill; LangSmith free tier covers most devs
提示
Use fetch_recent with a narrow window, not full history

安全

權限、密鑰、影響範圍

最小權限: LangSmith: read on your project(s)
憑證儲存: LANGCHAIN_API_KEY in env
資料出站: Only to LangSmith (where the traces already live)
切勿授予: Write to LangSmith — skill only reads

故障排查

常見錯誤與修復

langsmith-fetch: command not found

Install LangSmith CLI or ensure it's on PATH

驗證: which langsmith-fetch
Empty results

Check project name and time window; traces are project-scoped

替代方案

langsmith-fetch-skill 對比其他方案

替代方案何時用它替代權衡
LangSmith web UIYou prefer clickingNo Claude analysis

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills