Skip to main content
Glama

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
NameRequiredDescriptionDefault
category_idYesDocument360 category ID (UUID string)

Implementation Reference

  • 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)
  • 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
  • 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}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/druellan/document360-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server