Tavily Search Skill
🔭 Real-time web search powered by Tavily API - designed for AI agents.
Features
- ⚡ Fast Search - Results in <1s average
- 🤖 AI Answers - Optional AI-generated summaries
- 🖼️ Image Search - Include relevant images
- 🌐 Multi-language - Supports 100+ languages
- 🎯 Domain Filtering - Include/exclude specific domains
- 📊 Structured Results - Title, URL, content, relevance score
功能
- ⚡ 快速搜索 - 平均 <1 秒返回结果
- 🤖 AI 答案 - 可选 AI 生成的摘要
- 🖼️ 图片搜索 - 包含相关图片
- 🌐 多语言 - 支持 100+ 种语言
- 🎯 域名过滤 - 包含/排除特定域名
- 📊 结构化结果 - 标题、URL、内容、相关性分数
Installation
Option 1: Install from ClawHub
clawhub install tavily-search
Option 2: Manual Installation
# Clone or copy the skill to your workspace
cp -r tavily-search ~/.openclaw/workspace/skills/
# Create .env file with your API key
cp ~/.openclaw/workspace/skills/tavily-search/.env.example \
~/.openclaw/workspace/skills/tavily-search/.env
# Edit .env and add your Tavily API key
nano ~/.openclaw/workspace/skills/tavily-search/.env
安装方式
方式 1:从 ClawHub 安装
clawhub install tavily-search
方式 2:手动安装
# 复制技能到工作空间
cp -r tavily-search ~/.openclaw/workspace/skills/
# 创建 .env 文件
cp ~/.openclaw/workspace/skills/tavily-search/.env.example \
~/.openclaw/workspace/skills/tavily-search/.env
# 编辑 .env 并添加 Tavily API key
nano ~/.openclaw/workspace/skills/tavily-search/.env
Configuration
Step 1: Get Tavily API Key
- Go to Tavily Dashboard
- Sign up / Log in
- Copy your API key from the dashboard
Step 2: Configure API Key
Method A: Using .env file (Recommended)
Create ~/.openclaw/workspace/skills/tavily-search/.env:
TAVILY_API_KEY=tvly-your-api-key-here
Method B: Using environment variable
Add to ~/.bashrc or ~/.zshrc:
export TAVILY_API_KEY="tvly-your-api-key-here"
Then reload:
source ~/.bashrc # or source ~/.zshrc
配置
步骤 1:获取 Tavily API Key
- 访问 Tavily Dashboard
- 注册/登录
- 从控制台复制 API key
步骤 2:配置 API Key
方式 A:使用 .env 文件(推荐)
创建 ~/.openclaw/workspace/skills/tavily-search/.env:
TAVILY_API_KEY=tvly-your-api-key-here
方式 B:使用环境变量
添加到 ~/.bashrc 或 ~/.zshrc:
export TAVILY_API_KEY="tvly-your-api-key-here"
然后重新加载:
source ~/.bashrc # 或 source ~/.zshrc
Usage
Basic Search
# Run the search script
~/.openclaw/workspace/skills/tavily-search/tavily-search.js "your query"
# Or with options
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
--query "AI developments 2026" \
--max 5
With AI Answer
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"What is MCP protocol?" \
--answer \
--max 3
Advanced Search
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"machine learning" \
--depth advanced \
--max 10
Image Search
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"AI architecture" \
--images \
--max 5
Domain Filtering
# Only search specific domains
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"OpenClaw tutorial" \
--include-domains "youtube.com,github.com" \
--max 5
# Exclude domains
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"product reviews" \
--exclude-domains "reddit.com,pinterest.com" \
--max 5
使用方法
基础搜索
# 运行搜索脚本
~/.openclaw/workspace/skills/tavily-search/tavily-search.js "your query"
# 或带参数
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
--query "AI developments 2026" \
--max 5
带 AI 答案
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"What is MCP protocol?" \
--answer \
--max 3
高级搜索
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"machine learning" \
--depth advanced \
--max 10
图片搜索
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"AI architecture" \
--images \
--max 5
域名过滤
# 只搜索特定域名
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"OpenClaw tutorial" \
--include-domains "youtube.com,github.com" \
--max 5
# 排除域名
~/.openclaw/workspace/skills/tavily-search/tavily-search.js \
"product reviews" \
--exclude-domains "reddit.com,pinterest.com" \
--max 5
CLI Options
| Option | Short | Description | Default |
|---|---|---|---|
--query |
-q |
Search query | (required) |
--depth |
-d |
Search depth: basic or advanced |
basic |
--max |
-m |
Max results (1-20) | 5 |
--answer |
-a |
Include AI-generated answer | false |
--images |
-i |
Include image results | false |
--raw |
-r |
Include raw page content | false |
--include-domains |
- |
Comma-separated domains to include | [] |
--exclude-domains |
- |
Comma-separated domains to exclude | [] |
命令行选项
| 选项 | 简写 | 说明 | 默认值 |
|---|---|---|---|
--query |
-q |
搜索关键词 | (必填) |
--depth |
-d |
搜索深度:basic 或 advanced |
basic |
--max |
-m |
最大结果数 (1-20) | 5 |
--answer |
-a |
包含 AI 生成的答案 | false |
--images |
-i |
包含图片结果 | false |
--raw |
-r |
包含原始页面内容 | false |
--include-domains |
- |
要包含的域名(逗号分隔) | [] |
--exclude-domains |
- |
要排除的域名(逗号分隔) | [] |
Output Format
Success Response
🔭 Searching Tavily for: "query"...
✅ Found 5 results (0.87s)
🤖 AI Answer:
[AI-generated summary if --answer flag is used]
📋 Results:
1. Page Title
URL: https://example.com
Score: 0.95
Snippet content...
🖼️ Images (3):
1. https://example.com/image1.jpg
2. https://example.com/image2.jpg
3. https://example.com/image3.jpg
Error Response
❌ Error: TAVILY_API_KEY environment variable not set
Set it with:
1. Create .env file in the script directory
2. Or: export TAVILY_API_KEY="tvly-your-key-here"
3. Or add to ~/.bashrc or ~/.zshrc
输出格式
成功响应
🔭 Searching Tavily for: "query"...
✅ Found 5 results (0.87s)
🤖 AI Answer:
[如果使用 --answer 参数,显示 AI 生成的摘要]
📋 Results:
1. Page Title
URL: https://example.com
Score: 0.95
Snippet content...
🖼️ Images (3):
1. https://example.com/image1.jpg
2. https://example.com/image2.jpg
3. https://example.com/image3.jpg
错误响应
❌ Error: TAVILY_API_KEY environment variable not set
Set it with:
1. Create .env file in the script directory
2. Or: export TAVILY_API_KEY="tvly-your-key-here"
3. Or add to ~/.bashrc or ~/.zshrc
Security
⚠️ IMPORTANT: Never share your API key!
- Store API key in
.envfile (permissions: 600) - Never commit
.envto version control - Never share API key in public channels
- Rotate key immediately if leaked
See SECURITY.md for detailed security guidelines.
安全
⚠️ 重要:切勿分享你的 API key!
- 将 API key 存储在
.env文件中(权限:600) - 切勿将
.env提交到版本控制 - 切勿在公开渠道分享 API key
- 如泄露立即撤销并重新生成
详见 SECURITY.md 安全指南。
Troubleshooting
"TAVILY_API_KEY not set"
Solution: Make sure .env file exists and contains your API key:
cat ~/.openclaw/workspace/skills/tavily-search/.env
# Should show: TAVILY_API_KEY=tvly-xxxxx
"HTTP 401: Unauthorized"
Solution: Your API key is invalid. Check:
- Key is copied correctly (no extra spaces)
- Key is active in Tavily dashboard
- Account has available credits
"Rate limited"
Solution: Wait a few minutes and retry. Free tier: 1000 requests/month.
故障排除
"TAVILY_API_KEY not set"
解决方法: 确保 .env 文件存在并包含 API key:
cat ~/.openclaw/workspace/skills/tavily-search/.env
# 应该显示:TAVILY_API_KEY=tvly-xxxxx
"HTTP 401: Unauthorized"
解决方法: API key 无效。检查:
- Key 复制正确(无多余空格)
- Key 在 Tavily 控制台处于激活状态
- 账户有可用额度
"Rate limited"
解决方法: 等待几分钟后重试。免费额度:1000 次请求/月。
API Reference
For detailed API documentation, see:
API 参考
详细 API 文档:
License
MIT-0 - Free to use, modify, and redistribute. No attribution required.
许可证
MIT-0 - 可自由使用、修改和重新分发。无需署名。
Support
- Issues: https://github.com/tavily-ai/tavily-mcp/issues
- Discord: https://discord.gg/TPu2gkaWp2
- Docs: https://docs.tavily.com
