Static source inference · medium confidence · detected: Logging
Deprecated protocol patterns detected
Summary
news-agent exposes 3 well-defined news tools via FastMCP with strong naming conventions, clear descriptions, and comprehensive input schemas. All tools follow verb_noun patterns (search_news, get_top_headlines, read_article). Descriptions are actionable and guide LLM tool selection. Input parameters include type definitions, ranges, and enums where appropriate. However, output schemas are documented in docstrings rather than formally exposed in tool metadata, and error handling guidance is implicit rather than explicit. The server is well-structured but lacks some production-grade defensive patterns.
Tools (3)
get_top_headlinesread onlysource verified90/100
Get current headlines for a Google News topic section (top, world, business, technology, and so on). Returns headlines only — use read_article to get the body of a specific result.
read_articleread onlysource verified85/100
Download one news article and return its readable text, title, and lead image. Accepts a publisher URL or a news.google.com link.
search_newsread onlysource verified90/100
Search Google News for a keyword and return matching headlines with publisher URLs, sources, and timestamps. Returns headlines only — use read_article to get the body of a specific result.
Output schemas are documented in Python docstrings but not formally exposed to clients via MCP tool metadata. Clients cannot introspect return types statically.
Error handling is delegated to FastMCP middleware (ErrorHandlingMiddleware) but tool docstrings provide no recovery guidance. LLMs receive middleware-generated errors without context on retry strategy or alternatives.
No input validation or sanitization documented in tool implementations. Tools accept free-form strings (query, url) and pass them to external services without documented injection protections.
read_article accepts arbitrary URLs. No validation that URL is a news article or that it's safe to fetch. Could expose tool to SSRF or malicious redirect attacks.
Recommendations
Add formal output schema definitions to FastMCP tool registrations. Current docstrings document the return dict structure (query, language, region, count, articles with title/url/source/published), but clients see only Python docstrings. Use a Pydantic model or explicit schema dict to expose return types to MCP clients.
Enhance error messages with recovery guidance. Instead of relying on middleware to return raw errors, catch GoogleNewsError in each tool and return: '{"error": "Google News unreachable", "retry_hint": "Check network; service may be rate-limited. Retry in 30s.", "next_step": "Call get_top_headlines instead if specific search is not critical."}'
Document locale fallback behavior in search_news and get_top_headlines descriptions. Current descriptions mention language/region parameters but don't explain the three-tier fallback (per-call > env var > built-in). Add: 'Language and region default to server settings (GOOGLE_RSS_LANGUAGE, GOOGLE_RSS_REGION), typically en/US. Per-call overrides take precedence.'
Add URL validation to read_article. Check that the URL is http:// or https://, and optionally restrict to known news domains or Google News redirects. Document this validation: 'Accepts publisher URLs and news.google.com redirects only. Other URLs are rejected.'
Document what 'resolve_urls' means concretely. Current description: 'Resolve news.google.com links to publisher URLs. Slower but citable.' Add: 'When true, follows Google News redirect links to reach the original publisher article. When false, returns Google News URLs directly (faster but not suitable for citation). Recommend true for most use cases.'
Spec posture evidence
Inferred effective spec: 2026-07-28+.
Relies on Logging (deprecated) - log to stderr or use OpenTelemetry
get_top_headlines and search_news both return articles with identical structure but no guidance on when to use each. Description suggests search is for keywords and get_top_headlines for topics, but LLM reasoning could conflate them.
search_newsget_top_headlines
Add idempotency guidance. search_news and get_top_headlines are read-only and idempotent; read_article is also read-only. Explicitly state: 'This tool is read-only and safe to retry. Multiple identical calls return the same results.' This signals to LLM that retries are safe.
Document rate limits and timeouts. FastMCP server applies 10 req/sec limit via middleware, but tool descriptions don't mention this. Add to each tool: 'Rate limited to 10 requests per second. Timeout: 30 seconds (default GOOGLE_RSS_TIMEOUT).'
Return structured error details instead of exceptions. If resolve_urls=true fails to resolve a particular link, return per-article success/failure flags rather than failing the entire search. E.g., articles include 'resolved': true/false and 'resolved_url' fields, with a summary count.
Consider pagination for results. Currently max_results caps at 50 and returns a flat array. For large result sets, return a 'next_page_token' or 'has_more' flag so agents can iteratively fetch more headlines without re-querying.
Document dependency chains. Add to search_news: 'Typical flow: call this to find headlines matching a query, then call read_article on the 1-2 results most relevant to the user. Do not call read_article on all results, headlines alone answer most questions and save latency.'