
Web Search Tavily
Run Tavily-backed web search from the terminal so your coding agent gets LLM-friendly snippets and optional synthesized answers while you validate ideas or gather sources.
Overview
Web Search Tavily is an agent skill most often used in Idea (also Validate, Launch) that queries Tavily’s API via Deno CLI and returns ranked, LLM-friendly web results with optional answers.
Install
npx skills add https://github.com/jwynia/agent-skills --skill web-search-tavilyWhat is this skill?
- Standalone Deno CLI calling Tavily’s search API with basic and advanced depth modes
- Optional --answer flag for LLM-oriented synthesized answers alongside ranked results
- Topic filters: general, news, and finance with time-range and recency controls
- Structured result fields: title, URL, content, score, published_date, optional raw_content
- Requires TAVILY_API_KEY and scoped net permission to api.tavily.com only
- CLI version 1.0.0
- searchDepth basic|advanced
- topic general|news|finance
Adoption & trust: 1.1k installs on skills.sh; 92 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need current web sources your agent can cite, but ad-hoc browsing or generic search snippets are too noisy for automated research loops.
Who is it for?
Solo builders who already have a Tavily API key and want a scriptable search step inside agent or shell workflows.
Skip if: Teams that need interactive browser scraping, paywalled login flows, or search without a third-party API key and outbound network access.
When should I use this skill?
You need programmatic web search with Tavily from Deno or an agent shell step.
What do I get? / Deliverables
You get structured Tavily results (and optional answers) in the terminal ready to paste into specs, validation notes, or SEO briefs.
- Terminal JSON/text search results
- Optional synthesized answer string
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Idea because competitive and market research is the first moment solo builders need fast, citeable web results before committing to build. Research is where external facts, competitor pages, and trend signals are collected; this CLI is built for that retrieval loop.
Where it fits
Pull recent competitor positioning pages before you choose a niche.
Gather pricing and feature comparisons to sanity-check MVP scope.
Collect authoritative URLs to ground AI-search and content outlines.
How it compares
Use instead of asking the model to “search the web” from memory—this is a real API integration, not an MCP server.
Common Questions / FAQ
Who is web-search-tavily for?
Indie developers and agent users who want Tavily-quality retrieval in a Deno one-liner during research, validation, or content/SEO work.
When should I use web-search-tavily?
During Idea research for competitors and trends, Validate for market proof, Launch/SEO for source gathering, or anytime you need fresh URLs and excerpts for an agent context window.
Is web-search-tavily safe to install?
It needs your TAVILY_API_KEY and network access to api.tavily.com; review the Security Audits panel on this Prism page and rotate keys if you run it in shared environments.
SKILL.md
READMESKILL.md - Web Search Tavily
#!/usr/bin/env -S deno run --allow-env --allow-net=api.tavily.com /** * Web Search CLI - Tavily API Integration * * A standalone CLI script for searching the web using Tavily's AI-optimized search API. * Provides high-quality results designed for LLM consumption. * * Usage: * deno run --allow-env --allow-net=api.tavily.com scripts/search.ts "query" * deno run --allow-env --allow-net=api.tavily.com scripts/search.ts "query" --answer * deno run --allow-env --allow-net=api.tavily.com scripts/search.ts "query" --depth advanced * # Or if executable: ./scripts/search.ts "query" * * Environment Variables: * TAVILY_API_KEY - Required. Your Tavily API key from https://tavily.com * * Permissions: * --allow-env: Read TAVILY_API_KEY environment variable * --allow-net=api.tavily.com: Make API requests to Tavily */ // === Constants === const VERSION = "1.0.0"; const SCRIPT_NAME = "search"; // === Types === export interface TavilyResult { title: string; url: string; content: string; score?: number; published_date?: string; raw_content?: string; } export interface TavilyResponse { results: TavilyResult[]; answer?: string; query: string; response_time?: number; } export interface SearchOptions { query: string; maxResults?: number; topic?: "general" | "news" | "finance"; includeAnswer?: boolean; includeRawContent?: boolean; searchDepth?: "basic" | "advanced"; timeRange?: "day" | "week" | "month" | "year"; days?: number; includeDomains?: string[]; excludeDomains?: string[]; } // === Core Logic === export async function tavilySearch(options: SearchOptions): Promise<TavilyResponse> { const apiKey = Deno.env.get("TAVILY_API_KEY"); if (!apiKey) { throw new Error("TAVILY_API_KEY environment variable is not set"); } const requestBody: Record<string, unknown> = { query: options.query, max_results: options.maxResults ?? 5, topic: options.topic ?? "general", include_answer: options.includeAnswer ?? false, include_raw_content: options.includeRawContent ?? false, search_depth: options.searchDepth ?? "basic", }; if (options.timeRange) { requestBody.time_range = options.timeRange; } if (options.topic === "news" && options.days !== undefined) { requestBody.days = options.days; } if (options.includeDomains && options.includeDomains.length > 0) { requestBody.include_domains = options.includeDomains; } if (options.excludeDomains && options.excludeDomains.length > 0) { requestBody.exclude_domains = options.excludeDomains; } const startTime = Date.now(); const response = await fetch("https://api.tavily.com/search", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ api_key: apiKey, ...requestBody, }), }); if (!response.ok) { const errorText = await response.text(); if (response.status === 401) { throw new Error("Invalid Tavily API key"); } else if (response.status === 429) { throw new Error("Tavily API rate limit exceeded"); } else if (response.status === 400) { throw new Error(`Bad request: ${errorText}`); } throw new Error(`Tavily API error (${response.status}): ${errorText}`); } const data = await response.json(); const endTime = Date.now(); return { results: data.results?.map((r: TavilyResult) => ({ title: r.title || "", url: r.url || "", content: r.content || "", score: r.score, published_date: r.published_date, raw_content: r.raw_content, })) || [], answer: data.answer, query: data.query || options.query, response_time: endTime - startTime, }; } // === Help Text === function printHelp(): void { console.log(` ${SCRIPT_NAME} v${VERSION} - Web search using Tavily API Usage: deno run --allow-env --allow-net=api.tavily.com scripts/search.ts [options] "query" Arguments: "query" The search query (required