Skip to main content
Glama

get-category

Retrieve a specific category by providing its unique ID.

Instructions

Get a category by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCategory ID

Implementation Reference

  • build/index.js:628-630 (registration)
    Registration of the 'get-category' tool with the MCP server. It accepts an 'id' parameter (number) and has a description 'Get a category by ID'.
    server.tool("get-category", "Get a category by ID", {
        id: z.number().describe("Category ID")
    }, async ({ id }) => {
  • Handler function for the 'get-category' tool. It calls authenticatedRequest(`/categories/${id}`) with a GET request, then returns the category details as formatted JSON. On error, it returns an isError response.
    }, async ({ id }) => {
        try {
            const category = await authenticatedRequest(`/categories/${id}`);
            return {
                content: [{
                        type: "text",
                        text: `Category details:\n${JSON.stringify(category, null, 2)}`
                    }]
            };
        }
        catch (error) {
            return {
                isError: true,
                content: [{ type: "text", text: `Error fetching category: ${getErrorMessage(error)}` }]
            };
        }
    });
  • Input schema for 'get-category': requires an 'id' field of type z.number() described as 'Category ID'.
    id: z.number().describe("Category ID")
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It fails to disclose what happens if the ID is not found, permission requirements, or side effects. For a read tool, basic behavioral details are missing.

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

Conciseness5/5

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

Single sentence, no fluff, front-loaded with the purpose. Conciseness is optimal for a simple tool.

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

Completeness3/5

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

Given the simplicity (1 param, no output schema), the description is minimally adequate but lacks context about return value format or error behavior. It does not explain if the tool returns a full object or just an ID.

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?

The input schema has 100% coverage for the single parameter 'id' (described as 'Category ID'), so the description adds no additional meaning. Baseline score of 3 applies since schema coverage is high.

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 'Get a category by ID' clearly states the action (get) and the resource (category), and distinguishes it from sibling tools like list-categories (which returns all) and create/update/delete.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives (e.g., list-categories) or when not to use it. The agent receives no context about prerequisites or typical scenarios.

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/mingzilla/pi-api-mcp-server'

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