fakestore_delete_product
Remove products from the Fake Store API by specifying product ID. This simulation tool helps manage e-commerce test data without persistent changes.
Instructions
Delete a product (simulation - does not persist)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Product ID to delete |
Implementation Reference
- src/tools/products.ts:122-126 (handler)The deleteProduct function that executes the core logic of deleting a product by ID via the FakeStore API delete endpoint.export async function deleteProduct(args: { id: number }): Promise<Product> { const { id } = args; validatePositiveInteger(id, 'Product ID'); return del<Product>(`/products/${id}`); }
- src/tools/products.ts:250-263 (schema)Input schema definition and metadata for the fakestore_delete_product tool.{ name: 'fakestore_delete_product', description: 'Delete a product (simulation - does not persist)', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Product ID to delete', }, }, required: ['id'], }, },
- src/index.ts:109-114 (registration)Tool execution dispatcher that calls deleteProduct when fakestore_delete_product is invoked.if (name === 'fakestore_delete_product') { const result = await deleteProduct(args as { id: number }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:40-44 (registration)Registers the fakestore_delete_product tool (via productTools) for listing available tools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [...productTools, ...cartTools, ...userTools], }; });