list_categories
Retrieve the complete Zipp taxonomy of 35 categories to find valid category slugs for news search and retrieval.
Instructions
List the full Zipp taxonomy (7 main groups × 5 leaves = 35 categories total). Use to discover valid category slugs for the search / get_latest tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | en-US |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/zipp_mcp/server.py:192-201 (handler)The MCP tool handler function for 'list_categories'. It creates a ZippClient and delegates to client.list_categories().
async def list_categories( lang: str = _DEFAULT_LANG, ) -> dict[str, Any]: """List all active categories in the Zipp taxonomy. Args: lang: BCP-47 language tag (default en-US). """ async with ZippClient() as client: return await client.list_categories(lang=lang) - src/zipp_mcp/server.py:184-191 (registration)Registration of the 'list_categories' tool with FastMCP using @mcp.tool decorator, including its name and description.
@mcp.tool( name="list_categories", description=( "List the full Zipp taxonomy (7 main groups × 5 leaves = 35 " "categories total). Use to discover valid category slugs for " "the search / get_latest tools." ), ) - src/zipp_mcp/client.py:133-138 (helper)ZippClient.list_categories() — the low-level async method that makes the actual HTTP GET request to /api/v1/news/categories with an optional lang parameter.
async def list_categories( self, *, lang: str = "en-US", ) -> dict[str, Any]: return await self._get("/categories", params={"lang": lang}) - src/zipp_mcp/server.py:193-194 (schema)Input schema for the tool: a single optional 'lang' string parameter defaulting to 'en-US'.
lang: str = _DEFAULT_LANG, ) -> dict[str, Any]: - src/zipp_mcp/client.py:142-148 (helper)ZippClient._get() — internal helper used by list_categories (and all other methods) to perform the actual HTTP GET request and parse JSON response.
async def _get(self, path: str, *, params: dict[str, Any]) -> dict[str, Any]: # Drop None values so the upstream doesn't get e.g. ?category=None. clean = {k: v for k, v in params.items() if v is not None} resp = await self._client.get(_API_PREFIX + path, params=clean) if resp.status_code >= 400: raise ZippAPIError(resp.status_code, resp.text) return resp.json()