{"slug": "add-web-search-and-real-time-news-to-the-vercel-ai-sdk-npm-package-2026", "title": "Add web search and real-time news to the Vercel AI SDK (npm package, 2026)", "summary": "NestDaddy released @nestdaddy/ai-sdk, an MIT-licensed npm package that adds three tools — webSearch, newsSearch and readPage — to any generateText or streamText call in the Vercel AI SDK, giving models web search, real-time news filtered by age and country, and full-page text extraction. The company tested the package on 4 December 2026 with ai 7.1 and a local qwen2.5:7b model via Ollama, where the model called newsSearch with {\"query\":\"AI\",\"numResults\":3} and returned three of that day's AI headlines with links. The package requires a NestDaddy API key in NESTDADDY_API_KEY, validates tool arguments with zod before any request, and is sold alongside the Search & News API from USD 5 a month for 200,000 searches with a 7-day free trial.", "body_md": "# Add web search and real-time news to the Vercel AI SDK (npm package, 2026)\n\nA model on its own only knows its training data. How to give a Vercel AI SDK agent web search, news by country and age, and full-page reading with one npm package, with a tested TypeScript example.\n\nA model called through the Vercel AI SDK answers from its training data. Ask it what happened in AI this morning and it either guesses or says it does not know. The fix is a tool: a function the model can call to search the web, read the result, and then answer from what it found.\n\n`@nestdaddy/ai-sdk` is that tool, ready to use. It adds three tools to any `generateText` or `streamText` call.\n\n## Quick answers\n\n**What does it add?** `webSearch` (results with title, url, snippet and domain), `newsSearch` (real-time news filtered by age and country, newest and best match first) and `readPage` (the clean full text of a page, so the model reads the source before it states details).\n\n**Which models does it work with?** Any model the AI SDK supports, because the tools are plain AI SDK tools. We tested it with a local `qwen2.5:7b` through Ollama.\n\n**Do I need a key?** Yes, a NestDaddy API key in `NESTDADDY_API_KEY`. There is a 7-day free trial.\n\n## Install\n\n```\nnpm install @nestdaddy/ai-sdk ai\nexport NESTDADDY_API_KEY=\"your-key\"\n```\n\n## Use it\n\n``` js\nimport { generateText, isStepCount } from \"ai\";\nimport { nestdaddyTools } from \"@nestdaddy/ai-sdk\";\n\nconst { text } = await generateText({\n  model: \"openai/gpt-5-mini\",\n  prompt: \"What happened in AI today? Give 3 headlines with links.\",\n  tools: nestdaddyTools({ country: \"US\", newsDays: 2 }),\n  stopWhen: isStepCount(4),\n});\n\nconsole.log(text);\n```\n\n`nestdaddyTools()` returns all three tools. To pass only some, use `webSearch()`, `newsSearch()` and `readPage()` one by one. Options are `numResults`, `newsDays`, `country`, `maxChars`, `apiKey`, `baseUrl`, `timeoutMs` and `fetch`.\n\n## What happens when it runs\n\nWe ran this on 4 December 2026 with the package installed from npm, `ai` 7.1 and a local `qwen2.5:7b`. The model called `newsSearch` with `{\"query\":\"AI\",\"numResults\":3}` and answered with three of that day's AI headlines, each with its link. It did not need to guess the date or the news: the tool result had both.\n\n## Things that make it safe to ship\n\n- **Arguments are checked first.** The tools validate input with zod before any request, so a one-character query, a bad country code or a URL without a scheme never reaches the API.\n- **Errors reach the model.** A bad key, a used-up quota or a network problem throws a`NestDaddyError` with the status and message, which the AI SDK hands back to the model as a tool error instead of crashing your route.\n- **Compact results.** Tools return small objects, never raw API payloads, so they do not eat your context window.\n\n## Read the source before answering\n\nSearch results are headlines and snippets. For details, tell the model to read the best result with `readPage` before it states facts, and to cite the URL. Adding \"check the web, don't guess\" to the system prompt does the rest.\n\n## Pricing\n\nThe **[Search & News API](https://nestdaddy.com/serp-api)** covers web search, news search and financial and tech news with one key, from USD 5 a month for 200,000 searches, with a 7-day free trial: [plans](https://nestdaddy.com/serp-api#pricing). The package is open source (MIT). The full guide is at [Vercel AI SDK integration](https://nestdaddy.com/integrations/vercel-ai-sdk).\n\nPrefer MCP? The [NestDaddy MCP server](https://nestdaddy.com/mcp) works with the AI SDK's MCP client too. Using Python? See the [Pydantic AI guide](https://nestdaddy.com/blog/pydantic-ai-web-search-news).", "url": "https://wpnews.pro/news/add-web-search-and-real-time-news-to-the-vercel-ai-sdk-npm-package-2026", "canonical_source": "https://nestdaddy.com/blog/vercel-ai-sdk-web-search-news", "published_at": "2026-12-04 00:00:00+00:00", "updated_at": "2026-12-04 18:45:11.664553+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-search"], "entities": ["NestDaddy", "Vercel AI SDK", "@nestdaddy/ai-sdk", "qwen2.5:7b", "Ollama", "NestDaddy MCP server"], "also_reported_by": [], "takeaway": "@nestdaddy/ai-sdk adds webSearch, newsSearch and readPage as plain AI SDK tools, and in a 4 December 2026 test with ai 7.1 and local qwen2.5:7b the model answered with three current AI headlines and links by calling newsSearch instead of guessing.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/add-web-search-and-real-time-news-to-the-vercel-ai-sdk-npm-package-2026", "markdown": "https://wpnews.pro/news/add-web-search-and-real-time-news-to-the-vercel-ai-sdk-npm-package-2026.md", "text": "https://wpnews.pro/news/add-web-search-and-real-time-news-to-the-vercel-ai-sdk-npm-package-2026.txt", "jsonld": "https://wpnews.pro/news/add-web-search-and-real-time-news-to-the-vercel-ai-sdk-npm-package-2026.jsonld"}}