pydantic-ai-nestdaddy adds web search, news search by country and page reading to a Pydantic AI agent in one line. Install, run it with a free local model, use it in an agent spec, or take just the toolset.
A language model knows what it was trained on. It does not know what happened this morning, and it cannot read the page behind a headline. Pydantic AI has a clean answer for extending an agent: a capability that bundles tools and the instructions for using them.
We published one for NestDaddy: pydantic-ai-nestdaddy (source on GitHub, MIT). It gives an agent three tools and a short instruction on when to use each.
| Tool | What it does |
|---|---|
search_web |
Web results with title, url, snippet and domain. |
search_news |
Real-time news, newest and best match first, filtered by age in days and by a two-letter country code. |
read_page |
The clean full text of a page or article, so the agent reads the source before it states details. |
Install #
pip install pydantic-ai-nestdaddy "pydantic-ai-slim[openai]"
export NESTDADDY_API_KEY="your-key"
Get a key at nestdaddy.com/dashboard (a free plan is available).
One line #
This runs a free local model through Ollama (ollama pull qwen2.5:7b). For a hosted model, pass a name such as "openai:gpt-5" instead.
from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.ollama import OllamaProvider
from pydantic_ai_nestdaddy import NestDaddyCapability
model = OpenAIChatModel("qwen2.5:7b", provider=OllamaProvider(base_url="http://localhost:11434/v1"))
agent = Agent(model, capabilities=[NestDaddyCapability(country="US", news_days=2)])
result = agent.run_sync("What happened in AI today? Give 3 headlines with links.")
print(result.output)
What we got #
We ran exactly this on 3 December 2026 with Pydantic AI 2.78 and qwen2.5:7b. The agent made one call, search_news {"query": "AI", "num_results": 3}, and answered with three headlines, each linked to its source:
- What Healthcare's AI Leaders Can Teach About Checking AI's Work (Forbes)
- AI Has So Many Problems. Local AI Might Solve Them All (Wired)
- Suno Tries to Tie Christmas to AI With Holiday Remixes (Variety)
Without country="US" the same question returns the world's news, which on that day was mostly Chinese-language articles. That is the point of the country filter: say where the news should come from.
Options #
All optional: api_key (otherwise NESTDADDY_API_KEY), num_results (default 10), news_days (default 30), country, max_chars for read_page (default 8000) and timeout.
Only the tools #
If you prefer a plain toolset to a capability:
from pydantic_ai import Agent
from pydantic_ai_nestdaddy import nestdaddy_toolset
agent = Agent("openai:gpt-5", toolsets=[nestdaddy_toolset(country="US")])
Agent specs #
Every field is serializable, so the capability works in a YAML agent spec. This needs PyYAML (pip install "pydantic-ai-slim[spec]").
model: openai:gpt-5
capabilities:
- NestDaddy:
country: GB
news_days: 7
python
from pydantic_ai import Agent
from pydantic_ai_nestdaddy import NestDaddyCapability
agent = Agent.from_file("agent.yaml", custom_capability_types=[NestDaddyCapability])
How it behaves when something goes wrong #
- A one-character query, a malformed country code or a URL without
httpis caught locally and sent back to the model as a retry, without spending an API call. - A 400 or 422 from the API is also a retry, so the model can fix its own arguments. The toolset allows three retries.
- A bad key, a used-up quota or a network failure raises
NestDaddyErrorwith a clear message, because the model cannot fix those.
The tests run offline through httpx.MockTransport, so you can read them as documentation of the exact requests the tools send.
Why a capability and not just functions #
You can always write two plain functions, and we show that in our Pydantic AI guide. A capability adds the part people forget: the instruction that tells the model when to search news, when to search the web, and to read a page before relying on its details. Small local models in particular get this wrong without it. If the agent builds on a model with a short memory of the world, how to build an AI agent from scratch explains why the reading step matters.
Next #
The package and its PyPI page are live now. If you build agents in another framework, the same search, news and page reading come as an MCP server for Claude, Cursor and VS Code, and as plain REST calls in the API docs.