Skip to main content
Glama

update-category

Modify an existing category's properties including description, label, help text, object panel position, and cascading filters in the PI Dashboard.

Instructions

Update an existing category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCategory ID
descriptionNoUnique name of a category
labelNoAlternative text for the category
helpTextNoHelp text to describe the category
categoryObjectsPositionNoPosition of category objects panel
cascadeFiltersNoEnable cascading filters

Implementation Reference

  • The asynchronous handler function that implements the core logic for the 'update-category' tool. It constructs a payload from the provided optional parameters and performs a PUT request to `/categories/${id}` using authenticatedRequest, returning success or error content.
    }, async ({ id, description, label, helpText, categoryObjectsPosition, cascadeFilters }) => {
        try {
            const payload = {};
            if (description !== undefined)
                payload.description = description;
            if (label !== undefined)
                payload.label = label;
            if (helpText !== undefined)
                payload.helpText = helpText;
            if (categoryObjectsPosition !== undefined)
                payload.categoryObjectsPosition = categoryObjectsPosition;
            if (cascadeFilters !== undefined)
                payload.cascadeFilters = cascadeFilters;
            const result = await authenticatedRequest(`/categories/${id}`, "PUT", payload);
            return {
                content: [{
                        type: "text",
                        text: `Category updated successfully:\n${JSON.stringify(result, null, 2)}`
                    }]
            };
        }
        catch (error) {
            return {
                isError: true,
                content: [{ type: "text", text: `Error updating category: ${getErrorMessage(error)}` }]
            };
        }
    });
  • Input schema for the 'update-category' tool defined using Zod validators. Specifies required 'id' and optional fields for updating category properties.
    id: z.number().describe("Category ID"),
    description: z.string().optional().describe("Unique name of a category"),
    label: z.string().optional().describe("Alternative text for the category"),
    helpText: z.string().optional().describe("Help text to describe the category"),
    categoryObjectsPosition: z.enum(["RIGHT", "TOP"]).optional().describe("Position of category objects panel"),
    cascadeFilters: z.boolean().optional().describe("Enable cascading filters")
  • build/index.js:685-719 (registration)
    Registration of the 'update-category' tool using server.tool(), including the tool name, description, input schema, and inline handler function.
    server.tool("update-category", "Update an existing category", {
        id: z.number().describe("Category ID"),
        description: z.string().optional().describe("Unique name of a category"),
        label: z.string().optional().describe("Alternative text for the category"),
        helpText: z.string().optional().describe("Help text to describe the category"),
        categoryObjectsPosition: z.enum(["RIGHT", "TOP"]).optional().describe("Position of category objects panel"),
        cascadeFilters: z.boolean().optional().describe("Enable cascading filters")
    }, async ({ id, description, label, helpText, categoryObjectsPosition, cascadeFilters }) => {
        try {
            const payload = {};
            if (description !== undefined)
                payload.description = description;
            if (label !== undefined)
                payload.label = label;
            if (helpText !== undefined)
                payload.helpText = helpText;
            if (categoryObjectsPosition !== undefined)
                payload.categoryObjectsPosition = categoryObjectsPosition;
            if (cascadeFilters !== undefined)
                payload.cascadeFilters = cascadeFilters;
            const result = await authenticatedRequest(`/categories/${id}`, "PUT", payload);
            return {
                content: [{
                        type: "text",
                        text: `Category updated successfully:\n${JSON.stringify(result, null, 2)}`
                    }]
            };
        }
        catch (error) {
            return {
                isError: true,
                content: [{ type: "text", text: `Error updating category: ${getErrorMessage(error)}` }]
            };
        }
    });
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the tool updates an existing category but doesn't disclose permissions needed, whether changes are reversible, error handling, or response format. For a mutation tool, this leaves critical gaps in understanding its behavior.

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?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.

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

Completeness2/5

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

For a mutation tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't cover behavioral aspects like side effects, error cases, or return values, leaving the agent with incomplete context to use the tool effectively.

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 description coverage is 100%, so the schema fully documents all 6 parameters. The description adds no additional meaning beyond implying 'id' is required (matching schema) but doesn't explain parameter interactions or update semantics. Baseline 3 is appropriate as the schema handles parameter documentation.

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

Purpose3/5

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

The description 'Update an existing category' clearly states the action (update) and resource (category), but it's vague about what specifically gets updated. It doesn't differentiate from sibling tools like 'create-category' or 'get-category' beyond the verb, leaving ambiguity about scope and impact.

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 is provided on when to use this tool versus alternatives like 'create-category' or 'delete-category'. The description implies it's for modifying existing categories but doesn't specify prerequisites (e.g., needing an ID) or exclusions (e.g., not for new categories).

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