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)}` }] }; } });

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