Skip to main content
Glama
op-enny
by op-enny

fakestore_delete_product

Remove a product from the Fake Store API by specifying its ID. This tool simulates deletion for testing and demo purposes without persisting changes.

Instructions

Delete a product (simulation - does not persist)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesProduct ID to delete

Implementation Reference

  • Core handler function that validates the product ID and calls the API delete endpoint to remove the product.
    export async function deleteProduct(args: { id: number }): Promise<Product> {
      const { id } = args;
      validatePositiveInteger(id, 'Product ID');
      return del<Product>(`/products/${id}`);
    }
  • Tool schema definition including name, description, and input schema requiring a numeric 'id'.
    {
      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)
    Registration in the MCP call tool handler that dispatches to the deleteProduct function and formats the response.
    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:41-42 (registration)
    Tool list registration for ListToolsRequestSchema, which includes the fakestore_delete_product schema from productTools.
    return {
      tools: [...productTools, ...cartTools, ...userTools],

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/op-enny/mcp-server-fakestore'

If you have feedback or need assistance with the MCP directory API, please join our Discord server