create_category
Create new product categories in ConsignCloud to organize inventory for consignment and retail management.
Instructions
Create a new item category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Category name |
Implementation Reference
- src/server.ts:480-481 (handler)MCP tool handler for 'create_category': receives tool call parameters, invokes client.createCategory(args), and returns JSON-formatted response.case 'create_category': return { content: [{ type: 'text', text: JSON.stringify(await client.createCategory(args as any), null, 2) }] };
- src/server.ts:219-225 (schema)Input schema definition for the 'create_category' tool, specifying required 'name' property.inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Category name' }, }, required: ['name'], },
- src/server.ts:216-226 (registration)Registration of the 'create_category' tool in the tools list, including name, description, and schema.{ name: 'create_category', description: 'Create a new item category', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Category name' }, }, required: ['name'], }, },
- src/client.ts:274-277 (helper)Core implementation logic: HTTP POST request to ConsignCloud API '/item-categories' endpoint to create the category.async createCategory(data: Partial<ItemCategory>): Promise<ItemCategory> { const response = await this.client.post('/item-categories', data); return response.data; }
- src/types.ts:60-65 (schema)TypeScript interface defining the ItemCategory structure used for input (Partial) and output.export interface ItemCategory { id: string; name: string; created: string; deleted: string | null; }