360 Secure SkillHub
360 安全技能中心

langsmith-fetch

该 Skill 通过项目依赖中的 langsmith-fetch 和 LANGSMITH_API_KEY 获取 LangSmith 追踪记录,支持按项目、追踪 ID 和数量筛选,并可输出可读、JSON 或原始格式,用于人工排查代理及工具调用问题。

langchain-ai
热度 0.00
最近更新 2026-10-19 01:34:48
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:调试排错 / API 集成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add langchain-ai/lca-skills/langsmith-fetch
Metadata
name
langsmith-fetch
description
Fetches LangSmith traces for debugging agent behavior. Use when troubleshooting agent issues, reviewing conversation history, or investigating tool calls.

Fetching LangSmith Traces

Requires langsmith-fetch in project dependencies and LANGSMITH_API_KEY in a .env file.

Setup

First, find the .env file containing LANGSMITH_API_KEY:

find . -name ".env" -type f 2>/dev/null | head -5

Commands

Use --env-file <path-to-.env> with all commands:

# Fetch recent traces (uses LANGSMITH_PROJECT from .env, or specify --project-uuid)
uv run --env-file <path> langsmith-fetch traces ./traces --limit 10
uv run --env-file <path> langsmith-fetch traces ./traces --project-uuid <uuid> --limit 10

# Fetch single trace by ID
uv run --env-file <path> langsmith-fetch trace <trace-id>

# Include metadata (timing, tokens, costs)
uv run --env-file <path> langsmith-fetch trace <trace-id> --include-metadata

Output Formats

  • --format pretty - Human-readable (default)
  • --format json - Pretty-printed JSON
  • --format raw - Compact JSON for piping

Troubleshooting Workflow

  1. Find .env: find . -name ".env" -type f 2>/dev/null
  2. Fetch recent traces: uv run --env-file <path> langsmith-fetch traces ./debug --limit 10
  3. Find relevant trace in saved JSON files
  4. Check: What tools were called? What did they return? Was it correct/expected?