{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "name": "Retailys WebMCP Modern",
    "version": "1.0",
    "protocolVersion": "2025-06-18",
    "webmcpVersion": "1.0",
    "description": "Model Context Protocol agent interface for Primavera Modern storefront and cart operations",
    "serverInfo": {
        "name": "Retailys WebMCP Server",
        "version": "1.0.0"
    },
    "endpoints": {
        "rpc": "/webmcp/mcp",
        "mcp": "/webmcp/mcp",
        "manifest": "/webmcp/manifest.json"
    },
    "capabilities": {
        "tools": {
            "listChanged": false
        },
        "resources": {
            "subscribe": false,
            "listChanged": false
        }
    },
    "tools": [
        {
            "name": "modern_basket_mutate",
            "description": "Mutate shopping cart items: add product, remove item, or update quantity with tenant permission checks and non-blocking yielding.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "action": {
                        "type": "string",
                        "enum": [
                            "add",
                            "remove",
                            "update_quantity"
                        ],
                        "description": "Cart mutation operation"
                    },
                    "id": {
                        "type": "integer",
                        "description": "Article ID to mutate"
                    },
                    "articleId": {
                        "type": "integer",
                        "description": "Alternative key for Article ID"
                    },
                    "article_id": {
                        "type": "integer",
                        "description": "Alternative snake_case key for Article ID"
                    },
                    "count": {
                        "type": "integer",
                        "description": "Quantity of product (defaults to 1 for add)"
                    },
                    "variantId": {
                        "type": "integer",
                        "description": "Optional product variant ID"
                    },
                    "note": {
                        "type": "string",
                        "description": "Optional customer note for item"
                    }
                },
                "required": [
                    "action"
                ]
            }
        },
        {
            "name": "modern_basket_get_state",
            "description": "Retrieve current shopping basket state including item count, total price, currency, and item list.",
            "inputSchema": {
                "type": "object",
                "properties": {}
            }
        },
        {
            "name": "modern_search_catalog",
            "description": "Search product catalog and categories with text query and pagination.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "Search keyword query"
                    },
                    "page": {
                        "type": "integer",
                        "description": "Page number (1-based)"
                    },
                    "limit": {
                        "type": "integer",
                        "description": "Number of results per page"
                    }
                },
                "required": [
                    "query"
                ]
            }
        },
        {
            "name": "modern_get_product_context",
            "description": "Retrieve full product context and Schema.org metadata by article ID or URL.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Article ID"
                    },
                    "articleId": {
                        "type": "integer",
                        "description": "Alternative key for Article ID"
                    },
                    "article_id": {
                        "type": "integer",
                        "description": "Alternative snake_case key for Article ID"
                    },
                    "url": {
                        "type": "string",
                        "description": "Optional product URL path"
                    }
                }
            }
        },
        {
            "name": "modern_get_category_products",
            "description": "Retrieve category product listings, active facets, and price ranges.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "categoryId": {
                        "type": "integer",
                        "description": "Category ID"
                    },
                    "page": {
                        "type": "integer",
                        "description": "Page number (1-based)"
                    },
                    "sort": {
                        "type": "string",
                        "description": "Sort order (price_asc, price_desc, name_asc, newest)"
                    }
                }
            }
        },
        {
            "name": "modern_get_lightmetric_report",
            "description": "Retrieve real-time Core Web Vitals and LightMetric telemetry report.",
            "inputSchema": {
                "type": "object",
                "properties": {}
            }
        }
    ],
    "resources": [
        {
            "uri": "retailys://cart",
            "name": "Shopping Cart",
            "mimeType": "application/json",
            "description": "Current user shopping cart snapshot"
        },
        {
            "uri": "retailys://store/info",
            "name": "Store Information",
            "mimeType": "application/json",
            "description": "Active channel metadata, currency, and contact info"
        }
    ]
}