Skip to main content
Glama

create-category

Create a new category in the PI API MCP Server by specifying unique details such as description, organization ID, label, and help text. Manage category object positions and enable cascading filters for efficient organization.

Instructions

Create a new category

Input Schema

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

Implementation Reference

  • The core handler function implementing the 'create-category' tool logic. It builds a payload from validated inputs and performs an authenticated POST request to the '/categories' API endpoint, returning success or error content.
    }, async ({ description, orgId, label, helpText, categoryObjectsPosition, cascadeFilters }) => { try { const payload = { description, orgId }; 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", "POST", payload); return { content: [{ type: "text", text: `Category created successfully:\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error creating category: ${getErrorMessage(error)}` }] }; } });
  • Zod input schema defining parameters for the 'create-category' tool, including required fields (description, orgId) and optional fields (label, helpText, categoryObjectsPosition, cascadeFilters).
    description: z.string().describe("Unique name of a category"), orgId: z.number().describe("Organization ID"), 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:648-648 (registration)
    The server.tool registration call for the 'create-category' tool, specifying its name, description, input schema, and handler function.
    server.tool("create-category", "Create a new 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