search
Search Skill
Search the web and get relevant results optimized for LLM consumption.
Authentication
The script uses OAuth via the Tavily MCP server. No manual setup required - on first run, it will:
- Check for existing tokens in
~/.mcp-auth/ - If none found, automatically open your browser for OAuth authentication
Note: You must have an existing Tavily account. The OAuth flow only supports login — account creation is not available through this flow. Sign up at tavily.com first if you don't have an account.
Alternative: API Key
If you prefer using an API key, get one at https://tavily.com and add to ~/.claude/settings.json:
{
"env": {
"TAVILY_API_KEY": "tvly-your-api-key-here"
}
}
Quick Start
Using the Script
./scripts/search.sh '<json>'
python .\scripts\search.py '<json>'
pwsh .\scripts\search.ps1 '<json>'
Examples:
# Basic search
./scripts/search.sh '{"query": "python async patterns"}'
# With options
./scripts/search.sh '{"query": "React hooks tutorial", "max_results": 10}'
# Advanced search with filters
./scripts/search.sh '{"query": "AI news", "time_range": "week", "max_results": 10}'
# Domain-filtered search
./scripts/search.sh '{"query": "machine learning", "include_domains": ["arxiv.org", "github.com"], "search_depth": "advanced"}'
Basic Search
curl --request POST \
--url https://api.tavily.com/search \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"query": "latest developments in quantum computing",
"max_results": 5
}'
Advanced Search
curl --request POST \
--url https://api.tavily.com/search \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"query": "machine learning best practices",
"max_results": 10,
"search_depth": "advanced",
"include_domains": ["arxiv.org", "github.com"]
}'
API Reference
Endpoint
POST https://api.tavily.com/search
Headers
| Header | Value |
|---|---|
Authorization |
Bearer <TAVILY_API_KEY> |
Content-Type |
application/json |
Request Body
| Field | Type | Default | Description |
|---|---|---|---|
query |
string | Required | Search query (keep under 400 chars) |
max_results |
integer | 10 | Maximum results (0-20) |
search_depth |
string | "basic" |
ultra-fast, fast, basic, advanced |
topic |
string | "general" |
Search topic (general only) |
time_range |
string | null | day, week, month, year |
start_date |
string | null | Return results after this date (YYYY-MM-DD) |
end_date |
string | null | Return results before this date (YYYY-MM-DD) |
include_domains |
array | [] | Domains to include (max 300) |
exclude_domains |
array | [] | Domains to exclude (max 150) |
country |
string | null | Boost results from a specific country (general topic only) |
include_raw_content |
boolean | false | Include full page content |
include_images |
boolean | false | Include image results |
include_image_descriptions |
boolean | false | Include descriptions for images |
include_favicon |
boolean | false | Include favicon URL for each result |
Response Format
{
"query": "latest developments in quantum computing",
"results": [
{
"title": "Page Title",
"url": "https://example.com/page",
"content": "Extracted text snippet...",
"score": 0.85
}
],
"response_time": 1.2
}
Search Depth
| Depth | Latency | Relevance | Content Type |
|---|---|---|---|
ultra-fast |
Lowest | Lower | NLP summary |
fast |
Low | Good | Chunks |
basic |
Medium | High | NLP summary |
advanced |
Higher | Highest | Chunks |
When to use each:
ultra-fast: Real-time chat, autocompletefast: Need chunks but latency mattersbasic: General-purpose, balancedadvanced: Precision matters (default recommendation)
Examples
Domain-Filtered Search
curl --request POST \
--url https://api.tavily.com/search \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"query": "Python async best practices",
"include_domains": ["docs.python.org", "realpython.com", "github.com"],
"search_depth": "advanced"
}'
Search with Full Content
curl --request POST \
--url https://api.tavily.com/search \
--header "Authorization: Bearer $TAVILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"query": "React hooks tutorial",
"max_results": 3,
"include_raw_content": true
}'
Tips
- Keep queries under 400 characters - Think search query, not prompt
- Break complex queries into sub-queries - Better results than one massive query
- Use
include_domainsto focus on trusted sources - Use
time_rangefor recent information - Filter by
score(0-1) to get highest relevance results
More from l-yifan/skills
scientific-figure-pro
Generate publication-ready scientific figures in Python/matplotlib with a consistent figures4papers house style. Use when creating or refining academic bar/trend/heatmap/scatter/multi-panel figures, enforcing visual consistency, or exporting paper-ready PNG/PDF/SVG outputs.
31figures4papers-playbook
Locate and adapt real plotting examples from the figures4papers repository. Use when users ask for a figure in the style of specific papers/projects, want the closest existing script template, or need fast script selection by chart type/domain before customization.
30deep-wiki
Access AI-generated documentation and insights for GitHub repositories via DeepWiki. This skill should be used when exploring unfamiliar codebases, understanding repository architecture, finding implementation patterns, or asking questions about how a GitHub project works. Supports any public GitHub repository.
25gkg
Global Knowledge Graph for codebase analysis. This skill should be used when searching for code definitions (functions, classes, methods), finding references to symbols, understanding code structure, analyzing import usage, generating repository maps, or performing impact analysis before refactoring. Supports TypeScript, JavaScript, Python, Java, and more.
21gh-grep
Search real-world code examples across millions of GitHub repositories using grep.app. This skill should be used when looking for implementation patterns, API usage examples, library integration patterns, or production code references. Supports literal code search, regex patterns, and filtering by language/repo/path.
18github
Interact with GitHub repositories, issues, pull requests, and code via the GitHub MCP server. This skill should be used when managing repositories, creating/updating files, working with issues and PRs, searching code/repos/users, creating branches, and performing code reviews. Supports all major GitHub API operations.
16