Skip to main content
Glama

get_category

Retrieve category details by ID from Document360, including name, description, articles, and metadata.

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)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:89-103 (registration)
    The `get_category` tool is registered as an MCP tool using the @mcp.tool decorator on the server. It accepts a category_id (UUID string via Pydantic Field) and ctx, and delegates to tools.get_category().
    @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)
  • The `get_category` handler function in `inc/tools.py` is the core logic. It logs the request via ctx.info, calls `client.get_category(category_id)` on the Document360 API client, and handles Document360APIError and generic exceptions with appropriate logging and error propagation.
    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
  • The `get_category` method on the Document360Client class makes the actual HTTP GET request to `/v2/categories/{category_id}` via the internal `_request` method.
    async def get_category(self, category_id: str) -> Dict[str, Any]:
        """Get category by ID"""
        return await self._request("GET", f"/categories/{category_id}")
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden for behavioral disclosure. It describes the return information (name, description, articles, metadata) and implies a read-only operation. However, it does not mention any potential side effects, auth requirements, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with the key purpose in the first line, followed by argument and return details. It is fairly concise but the docstring-style list could be more tersely written.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has only one parameter, an output schema exists, and the description specifies return fields, it provides complete context for an agent to understand and use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description text for the parameter is identical to the schema description. The description adds no additional meaning beyond what the input schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get'), resource ('category'), and scope ('by ID from Document360'). It effectively distinguishes from sibling tools like get_article (different entity) and search_in_project (search vs. direct fetch).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for fetching a single category by ID but does not explicitly state when not to use it or mention alternative tools. For example, it doesn't contrast with get_category_page_content or list_project_versions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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