get_category
Retrieve category details including name, description, articles, and metadata from Document360 knowledge base using a category ID.
Instructions
Get category by ID from Document360
Args: category_id: Document360 category ID (UUID string) ctx: MCP context for logging and error handling
Returns: Category information including name, description, articles, and metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category_id | Yes | Document360 category ID (UUID string) |
Implementation Reference
- server.py:90-104 (handler)MCP tool handler and registration for 'get_category'. Includes schema via Annotated parameters and docstring. Delegates to helper in inc/tools.py.@mcp.tool async def get_category( category_id: Annotated[str, Field(description="Document360 category ID (UUID string)")], ctx: Context ) -> dict: """Get category by ID from Document360 Args: category_id: Document360 category ID (UUID string) ctx: MCP context for logging and error handling Returns: Category information including name, description, articles, and metadata """ return await tools.get_category(category_id, ctx)
- inc/tools.py:92-119 (helper)Helper function providing MCP-aware implementation: logging, Document360-specific error handling, and delegation to client.async def get_category(category_id: str, ctx: Context) -> Dict[str, Any]: """Get category by ID from Document360 Args: category_id: Document360 category ID (UUID string) ctx: MCP context for logging and error handling Returns: Category data from Document360 API """ try: await ctx.info(f"Fetching category with ID: {category_id}") result = await client.get_category(category_id) await ctx.info("Successfully retrieved category") return result except Document360APIError as e: await ctx.error(f"Document360 API error: {e.message}") if e.status_code == 404: await ctx.warning(f"Category {category_id} not found") elif e.status_code == 401: await ctx.error("Invalid API key - check configuration") raise e except Exception as e: await ctx.error(f"Unexpected error fetching category: {str(e)}") raise e
- inc/document360_client.py:54-56 (helper)Core API client implementation that makes the HTTP GET request to Document360 /v2/categories/{category_id} endpoint.async def get_category(self, category_id: str) -> Dict[str, Any]: """Get category by ID""" return await self._request("GET", f"/categories/{category_id}")