tavily-web

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tavily Web Skill

Tavily 网页调研Skill

Trigger Conditions & Endpoint Selection

触发条件与端点选择

Choose Tavily endpoint based on user intent:
  • search: Need to "search web / latest info / find sources / find links"
  • extract: Given URL(s), need to extract/summarize content
  • crawl: Need to traverse site following instructions and scrape page content
  • map: Need to discover site page list/structure (without full content or metadata only)
  • research: Need structured research output following given
    output_schema
根据用户意图选择Tavily端点:
  • search:需要“搜索网页/获取最新信息/查找来源/查找链接”
  • extract:给定URL时,需要提取/总结内容
  • crawl:需要按照指令遍历站点并抓取页面内容
  • map:需要探索站点页面列表/结构(无需完整内容或仅需元数据)
  • research:需要按照给定的
    output_schema
    生成结构化调研输出

Recommended Architecture (Main Skill + Sub-skill)

推荐架构(主Skill + 子Skill)

This skill uses a two-phase architecture:
  1. Main skill (current context): Understand user question → Choose endpoint → Assemble JSON payload
  2. Sub-skill (fork context): Only responsible for HTTP call execution, avoiding conversation history token waste
该Skill采用两阶段架构:
  1. 主Skill(当前上下文):理解用户问题 → 选择端点 → 组装JSON请求体
  2. 子Skill(分支上下文):仅负责执行HTTP调用,避免浪费对话历史的token

Execution Method

执行方法

Use Task tool to invoke
tavily-fetcher
sub-skill, passing command and JSON (stdin):
Task parameters:
- subagent_type: Bash
- description: "Call Tavily API"
- prompt: cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js <search|extract|crawl|map|research>
  { ...payload... }
  JSON
使用Task工具调用
tavily-fetcher
子Skill,传递命令和JSON(标准输入):
Task parameters:
- subagent_type: Bash
- description: "Call Tavily API"
- prompt: cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js <search|extract|crawl|map|research>
  { ...payload... }
  JSON

Payload Examples (Based on Provided curl)

请求体示例(基于提供的curl命令)

1) Search the web

1) 网页搜索

bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js search
{
  "query": "who is Leo Messi?",
  "auto_parameters": false,
  "topic": "general",
  "search_depth": "basic",
  "chunks_per_source": 3,
  "max_results": 1,
  "time_range": null,
  "start_date": "2025-02-09",
  "end_date": "2025-12-29",
  "include_answer": false,
  "include_raw_content": false,
  "include_images": false,
  "include_image_descriptions": false,
  "include_favicon": false,
  "include_domains": [],
  "exclude_domains": [],
  "country": null,
  "include_usage": false
}
JSON
bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js search
{
  "query": "who is Leo Messi?",
  "auto_parameters": false,
  "topic": "general",
  "search_depth": "basic",
  "chunks_per_source": 3,
  "max_results": 1,
  "time_range": null,
  "start_date": "2025-02-09",
  "end_date": "2025-12-29",
  "include_answer": false,
  "include_raw_content": false,
  "include_images": false,
  "include_image_descriptions": false,
  "include_favicon": false,
  "include_domains": [],
  "exclude_domains": [],
  "country": null,
  "include_usage": false
}
JSON

2) Extract webpages

2) 网页内容提取

bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js extract
{
  "urls": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "query": "<string>",
  "chunks_per_source": 3,
  "extract_depth": "basic",
  "include_images": false,
  "include_favicon": false,
  "format": "markdown",
  "timeout": "None",
  "include_usage": false
}
JSON
bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js extract
{
  "urls": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "query": "<string>",
  "chunks_per_source": 3,
  "extract_depth": "basic",
  "include_images": false,
  "include_favicon": false,
  "format": "markdown",
  "timeout": "None",
  "include_usage": false
}
JSON

3) Crawl webpages

3) 网页爬取

bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js crawl
{
  "url": "docs.tavily.com",
  "instructions": "Find all pages about the Python SDK",
  "chunks_per_source": 3,
  "max_depth": 1,
  "max_breadth": 20,
  "limit": 50,
  "select_paths": null,
  "select_domains": null,
  "exclude_paths": null,
  "exclude_domains": null,
  "allow_external": true,
  "include_images": false,
  "extract_depth": "basic",
  "format": "markdown",
  "include_favicon": false,
  "timeout": 150,
  "include_usage": false
}
JSON
bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js crawl
{
  "url": "docs.tavily.com",
  "instructions": "Find all pages about the Python SDK",
  "chunks_per_source": 3,
  "max_depth": 1,
  "max_breadth": 20,
  "limit": 50,
  "select_paths": null,
  "select_domains": null,
  "exclude_paths": null,
  "exclude_domains": null,
  "allow_external": true,
  "include_images": false,
  "extract_depth": "basic",
  "format": "markdown",
  "include_favicon": false,
  "timeout": 150,
  "include_usage": false
}
JSON

4) Map webpages

4) 站点映射

bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js map
{
  "url": "docs.tavily.com",
  "instructions": "Find all pages about the Python SDK",
  "max_depth": 1,
  "max_breadth": 20,
  "limit": 50,
  "select_paths": null,
  "select_domains": null,
  "exclude_paths": null,
  "exclude_domains": null,
  "allow_external": true,
  "timeout": 150,
  "include_usage": false
}
JSON
bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js map
{
  "url": "docs.tavily.com",
  "instructions": "Find all pages about the Python SDK",
  "max_depth": 1,
  "max_breadth": 20,
  "limit": 50,
  "select_paths": null,
  "select_domains": null,
  "exclude_paths": null,
  "exclude_domains": null,
  "allow_external": true,
  "timeout": 150,
  "include_usage": false
}
JSON

5) Create Research Task

5) 创建结构化调研任务

bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js research
{
  "input": "What are the latest developments in AI?",
  "model": "auto",
  "stream": false,
  "output_schema": {
    "properties": {
      "company": {
        "type": "string",
        "description": "The name of the company"
      },
      "key_metrics": {
        "type": "array",
        "description": "List of key performance metrics",
        "items": {
          "type": "string"
        }
      },
      "financial_details": {
        "type": "object",
        "description": "Detailed financial breakdown",
        "properties": {
          "operating_income": {
            "type": "number",
            "description": "Operating income for the period"
          }
        }
      }
    },
    "required": [
      "company"
    ]
  },
  "citation_format": "numbered"
}
JSON
bash
cat <<'JSON' | node .claude/skills/tavily-web/tavily-api.js research
{
  "input": "What are the latest developments in AI?",
  "model": "auto",
  "stream": false,
  "output_schema": {
    "properties": {
      "company": {
        "type": "string",
        "description": "The name of the company"
      },
      "key_metrics": {
        "type": "array",
        "description": "List of key performance metrics",
        "items": {
          "type": "string"
        }
      },
      "financial_details": {
        "type": "object",
        "description": "Detailed financial breakdown",
        "properties": {
          "operating_income": {
            "type": "number",
            "description": "Operating income for the period"
          }
        }
      }
    },
    "required": [
      "company"
    ]
  },
  "citation_format": "numbered"
}
JSON

Environment Variables & API Key

环境变量与API密钥

Two ways to configure API Key (priority: environment variable >
.env
):
  1. Environment variable:
    TAVILY_API_KEY
  2. .env
    file: Place in
    .claude/skills/tavily-web/.env
    , can copy from
    .env.example
配置API密钥的两种方式(优先级:环境变量 >
.env
文件):
  1. 环境变量:
    TAVILY_API_KEY
  2. .env
    文件:放置在
    .claude/skills/tavily-web/.env
    ,可从
    .env.example
    复制