Skip to main content
Glama
kishimoto-banana

Shopify Python MCP Server

delete_product

Remove a product from your Shopify store by specifying its unique product ID using this tool, simplifying store inventory management.

Instructions

商品を削除する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYes商品ID

Implementation Reference

  • The main handler function for the delete_product tool. It validates the product_id argument, retrieves the product using Shopify's Product.find(), stores the title, deletes the product with product.destroy(), and returns a success JSON message including the deleted product's title.
    async def handle_delete_product(arguments: dict) -> list[types.TextContent]:
        """商品を削除する"""
        # 必須パラメータのチェック
        product_id = arguments.get("product_id")
        if not product_id:
            raise ValueError("product_id is required")
    
        # 商品の取得
        product = shopify.Product.find(product_id)
    
        # 商品名を保存
        product_title = product.title
    
        # 商品の削除
        product.destroy()
    
        return [
            types.TextContent(
                type="text",
                text=json.dumps(
                    {
                        "success": True,
                        "message": f"商品「{product_title}」が削除されました",
                    },
                    indent=2,
                    ensure_ascii=False,
                ),
            )
        ]
  • Registers the delete_product tool within the server's list_tools() handler, specifying the tool name, description in Japanese ('商品を削除する' meaning 'Delete product'), and input schema requiring a numeric product_id.
    types.Tool(
        name="delete_product",
        description="商品を削除する",
        inputSchema={
            "type": "object",
            "properties": {
                "product_id": {"type": "number", "description": "商品ID"}
            },
            "required": ["product_id"],
        },
    ),
  • Defines the input schema for the delete_product tool: an object with a required 'product_id' property of type number, described as '商品ID' (Product ID).
    inputSchema={
        "type": "object",
        "properties": {
            "product_id": {"type": "number", "description": "商品ID"}
        },
        "required": ["product_id"],
    },
  • In the server's call_tool() handler, dispatches execution to the handle_delete_product function when the tool name matches 'delete_product', passing the arguments.
    elif name == "delete_product":
        return await handle_delete_product(arguments or {})
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While '削除する' (delete) implies a destructive mutation, the description doesn't specify whether deletion is permanent, requires specific permissions, has side effects (e.g., cascading deletions), or provides confirmation feedback. This is inadequate for a destructive tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence ('商品を削除する') that directly states the tool's action without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical context: what happens on success/failure, whether deletion is reversible, permission requirements, or error conditions. Given the complexity and risk of deletion operations, this minimal description doesn't provide enough information for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the product_id parameter is fully documented in the schema as '商品ID'), so the baseline is 3. The description adds no additional parameter semantics beyond what the schema already provides—it doesn't explain format constraints, validation rules, or example values for product_id.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '商品を削除する' (deletes a product) clearly states the verb (delete) and resource (product), making the basic purpose understandable. However, it doesn't differentiate this destructive operation from its sibling tools (create_product, get_product, list_products, update_product) beyond the obvious verb difference, missing opportunities to clarify scope or constraints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., product must exist), consequences (e.g., irreversible deletion), or relationships with sibling tools (e.g., use get_product first to verify). This leaves the agent without contextual usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/kishimoto-banana/shopify-py-mcp'

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