get_latest
Get news articles published within the last 24 hours, optionally filtered by category, sorted with most recent first.
Instructions
Latest news from the last 24 hours. Optionally scoped to a category. Returns posts ordered newest-first. Use for 'what's new today?' or 'what happened in DeFi today?'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | en-US | |
| category | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/zipp_mcp/server.py:94-115 (handler)The MCP tool handler for 'get_latest'. Decorated with @mcp.tool, it accepts lang, category, and limit parameters, creates a ZippClient, and delegates to the client's get_latest method.
@mcp.tool( name="get_latest", description=( "Latest news from the last 24 hours. Optionally scoped to a " "category. Returns posts ordered newest-first. Use for 'what's " "new today?' or 'what happened in DeFi today?'." ), ) async def get_latest( lang: str = _DEFAULT_LANG, category: str | None = None, limit: int = _DEFAULT_LIMIT, ) -> dict[str, Any]: """Get latest news from the last 24h. Args: lang: BCP-47 language tag (default en-US). category: Optional category slug (see list_categories). limit: Max results (1-30, default 10). """ async with ZippClient() as client: return await client.get_latest(lang=lang, category=category, limit=limit) - src/zipp_mcp/server.py:94-101 (schema)The MCP tool decorator registers 'get_latest' with its name and description. The schema is inferred from the function signature parameters (lang: str, category: str | None, limit: int).
@mcp.tool( name="get_latest", description=( "Latest news from the last 24 hours. Optionally scoped to a " "category. Returns posts ordered newest-first. Use for 'what's " "new today?' or 'what happened in DeFi today?'." ), ) - src/zipp_mcp/server.py:94-101 (registration)The @mcp.tool decorator registers 'get_latest' into the FastMCP server instance, making it available via MCP tool listing.
@mcp.tool( name="get_latest", description=( "Latest news from the last 24 hours. Optionally scoped to a " "category. Returns posts ordered newest-first. Use for 'what's " "new today?' or 'what happened in DeFi today?'." ), ) - src/zipp_mcp/client.py:95-105 (helper)Helper method on ZippClient that builds HTTP params and calls GET /api/v1/news/latest on the Zipp REST API to fetch the latest 24h news.
async def get_latest( self, *, lang: str = "en-US", category: str | None = None, limit: int = 10, ) -> dict[str, Any]: params: dict[str, Any] = {"lang": lang, "limit": limit} if category: params["category"] = category return await self._get("/latest", params=params)