tavily_extract
Extract clean content from web pages by removing ads and navigation elements. Use this tool to retrieve main content from multiple URLs for research or analysis.
Instructions
Extract clean content from one or more URLs. Returns the main content from web pages, removing ads and navigation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | Array of URLs to extract content from |
Implementation Reference
- index.js:232-245 (handler)Handler for the tavily_extract tool: calls tavilyClient.extract with the provided URLs and returns the JSON result as text content.case "tavily_extract": { const result = await tavilyClient.extract({ urls: args.urls, }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- index.js:135-152 (registration)Registration of the tavily_extract tool in the ListTools response, including name, description, and input schema.{ name: "tavily_extract", description: "Extract clean content from one or more URLs. Returns the main content from web pages, removing ads and navigation.", inputSchema: { type: "object", properties: { urls: { type: "array", items: { type: "string", }, description: "Array of URLs to extract content from", }, }, required: ["urls"], }, },
- index.js:139-151 (schema)Input schema definition for the tavily_extract tool.inputSchema: { type: "object", properties: { urls: { type: "array", items: { type: "string", }, description: "Array of URLs to extract content from", }, }, required: ["urls"], },
- index.js:36-53 (helper)TavilyClient.extract method: performs the HTTP POST to Tavily's /extract endpoint with API key and parameters.async extract(params) { const response = await fetch(`${this.baseUrl}/extract`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ api_key: this.apiKey, ...params, }), }); if (!response.ok) { throw new Error(`Tavily API error: ${response.statusText}`); } return await response.json(); }