get_item
Retrieve detailed information about a specific inventory item using its unique ID for inventory management and tracking.
Instructions
Get details of a specific inventory item by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Item ID (UUID) |
Implementation Reference
- src/server.ts:432-433 (handler)MCP tool handler that processes the 'get_item' call by extracting the 'id' argument, fetching the item via the ConsignCloudClient, and returning a JSON-formatted text response.case 'get_item': return { content: [{ type: 'text', text: JSON.stringify(await client.getItem((args as any).id), null, 2) }] };
- src/server.ts:31-37 (schema)Input schema defining the required 'id' parameter (string UUID) for the get_item tool.inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Item ID (UUID)' }, }, required: ['id'], },
- src/server.ts:28-38 (registration)Tool registration object for 'get_item' including name, description, and input schema, part of the tools list provided to MCP ListToolsRequest.{ name: 'get_item', description: 'Get details of a specific inventory item by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Item ID (UUID)' }, }, required: ['id'], }, },
- src/client.ts:95-98 (helper)Helper function implementing the core logic: HTTP GET request to the ConsignCloud API endpoint `/items/${id}` followed by response conversion.async getItem(id: string): Promise<Item> { const response = await this.client.get(`/items/${id}`); return this.convertItemResponse(response.data); }
- src/client.ts:400-406 (helper)Supporting utility to convert raw API item response (prices in cents) to store currency units using convertFromApiCents.private convertItemResponse(item: any): Item { return { ...item, tag_price: this.convertFromApiCents(item.tag_price), cost: item.cost ? this.convertFromApiCents(item.cost) : undefined, }; }