Skip to main content
Glama

update-category

Modify existing category details in the PI Dashboard, including description, label, help text, panel position, and cascading filters, using the MCP Server API.

Instructions

Update an existing category

Input Schema

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

Implementation Reference

  • The main handler function for the 'update-category' tool. It constructs a payload from optional parameters, makes an authenticated PUT request to `/categories/${id}`, and returns a success message with the result or an error message.
    }, 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)}` }] }; } });
  • Zod schema defining the input parameters for the tool, including 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-685 (registration)
    Registration of the 'update-category' tool using server.tool(), specifying name, description, schema, and inline handler.
    server.tool("update-category", "Update an existing category", {

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