update_item
Modify existing inventory items in ConsignCloud by updating details like title, price, category, quantity, and split percentage for consignment management.
Instructions
Update an existing inventory item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Item ID | |
| title | No | ||
| description | No | ||
| tag_price | No | Price in cents | |
| category | No | ||
| split | No | Split percentage (0-1) | |
| quantity | No |
Implementation Reference
- src/server.ts:438-440 (handler)MCP tool handler for 'update_item': extracts item ID and data from arguments, calls client.updateItem, and returns the JSON-stringified result.case 'update_item': const { id: itemId, ...itemData } = args as any; return { content: [{ type: 'text', text: JSON.stringify(await client.updateItem(itemId, itemData), null, 2) }] };
- src/server.ts:62-78 (registration)Registration of the 'update_item' tool in createTools(), including name, description, and input JSON schema.{ name: 'update_item', description: 'Update an existing inventory item', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Item ID' }, title: { type: 'string' }, description: { type: 'string' }, tag_price: { type: 'number', description: 'Price in cents' }, category: { type: 'string' }, split: { type: 'number', description: 'Split percentage (0-1)' }, quantity: { type: 'number' }, }, required: ['id'], }, },
- src/client.ts:111-120 (helper)Implementation of updateItem in ConsignCloudClient: converts price/cost to API cents, performs PATCH request to /items/{id}, and converts response back to client format.async updateItem(id: string, data: Partial<Item>): Promise<Item> { // Convert user input to API cents const apiData = { ...data, tag_price: data.tag_price ? this.convertToApiCents(data.tag_price) : undefined, cost: data.cost ? this.convertToApiCents(data.cost) : undefined, }; const response = await this.client.patch(`/items/${id}`, apiData); return this.convertItemResponse(response.data); }