{
  "version": "agala.v1",
  "tools": [
    {
      "name": "compare_prices",
      "title": "Compare prices",
      "widget": true,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "products": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product": {
                  "description": "The product as a shopper says it, in Hebrew when possible, with brand, size and fat % when known: \"חלב תנובה 3% 1 ליטר\", \"במבה 80 גרם\", \"קוטג' 5%\", \"עגבניות\".",
                  "type": "string",
                  "maxLength": 120
                },
                "barcode": {
                  "description": "A barcode (EAN/GTIN) when known, e.g. from an earlier result. Takes precedence over the text.",
                  "type": "string",
                  "maxLength": 20
                },
                "any_brand": {
                  "description": "true when any brand will do (\"the cheapest milk\"): each chain's cheapest matching product of a similar size is compared instead of one exact barcode.",
                  "type": "boolean"
                }
              }
            },
            "description": "One to ten products to price at every chain. Each needs `product` or `barcode`."
          },
          "location": {
            "description": "Where the user shops: prices differ by region. Pass it whenever the user said where they live or shop. Omitted, prices are for Tel Aviv & Gush Dan and the result says so.",
            "type": "object",
            "properties": {
              "city": {
                "description": "The city or town the user shops in, ideally in Hebrew as Israelis write it (\"רמת גן\", \"באר שבע\", \"מודיעין\"). English works for big cities.",
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "options": {
            "description": "Optional settings.",
            "type": "object",
            "properties": {
              "chains": {
                "description": "Only these chains, by id or name: shufersal (שופרסל), rami-levy (רמי לוי), carrefour (קרפור), osher-ad (אושר עד), yohananof (יוחננוף), tiv-taam (טיב טעם), keshet (קשת טעמים).",
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 30
                }
              },
              "include_club_deals": {
                "description": "Count club-member and credit-card deals in the prices. Default false: only deals open to everyone are priced in; club deals are still shown.",
                "type": "boolean"
              }
            }
          }
        },
        "required": [
          "products"
        ]
      }
    },
    {
      "name": "compare_cart",
      "title": "Compare a shopping cart",
      "widget": true,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "minItems": 1,
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product": {
                  "description": "The product as a shopper says it, in Hebrew when possible, with brand, size and fat % when known: \"חלב תנובה 3% 1 ליטר\", \"במבה 80 גרם\", \"קוטג' 5%\", \"עגבניות\".",
                  "type": "string",
                  "maxLength": 120
                },
                "barcode": {
                  "description": "A barcode (EAN/GTIN) when known, e.g. from an earlier result. Takes precedence over the text.",
                  "type": "string",
                  "maxLength": 20
                },
                "quantity": {
                  "description": "How many units (default 1). For produce, meat and other items sold by weight: kilograms (0.5 = half a kilo).",
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 100
                },
                "any_brand": {
                  "description": "true when any brand will do (\"the cheapest milk\"): each chain's cheapest matching product of a similar size is compared instead of one exact barcode.",
                  "type": "boolean"
                }
              }
            },
            "description": "The shopping list, one entry per product. Each needs `product` or `barcode`."
          },
          "location": {
            "description": "Where the user shops: prices differ by region. Pass it whenever the user said where they live or shop. Omitted, prices are for Tel Aviv & Gush Dan and the result says so.",
            "type": "object",
            "properties": {
              "city": {
                "description": "The city or town the user shops in, ideally in Hebrew as Israelis write it (\"רמת גן\", \"באר שבע\", \"מודיעין\"). English works for big cities.",
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "options": {
            "description": "Optional settings.",
            "type": "object",
            "properties": {
              "chains": {
                "description": "Only these chains, by id or name: shufersal (שופרסל), rami-levy (רמי לוי), carrefour (קרפור), osher-ad (אושר עד), yohananof (יוחננוף), tiv-taam (טיב טעם), keshet (קשת טעמים).",
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 30
                }
              },
              "include_club_deals": {
                "description": "Count club-member and credit-card deals in the prices. Default false: only deals open to everyone are priced in; club deals are still shown.",
                "type": "boolean"
              },
              "max_stores": {
                "description": "1: the best single chain only. 2 (default): also suggest splitting the cart between two chains when it saves enough.",
                "type": "integer",
                "minimum": 1,
                "maximum": 2
              },
              "suggest_swaps": {
                "description": "Suggest cheaper same-size equivalents (often the chain's own label). Default true.",
                "type": "boolean"
              }
            }
          }
        },
        "required": [
          "items"
        ]
      }
    },
    {
      "name": "search_products",
      "title": "Search products",
      "widget": true,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "What to look for: a product, a kind of product, a brand or a barcode (\"שוקולד פרה\", \"חומוס\", \"תנובה\", \"7290000066318\")."
          },
          "location": {
            "description": "Where the user shops: prices differ by region. Pass it whenever the user said where they live or shop. Omitted, prices are for Tel Aviv & Gush Dan and the result says so.",
            "type": "object",
            "properties": {
              "city": {
                "description": "The city or town the user shops in, ideally in Hebrew as Israelis write it (\"רמת גן\", \"באר שבע\", \"מודיעין\"). English works for big cities.",
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "filters": {
            "description": "Optional narrowing.",
            "type": "object",
            "properties": {
              "chains": {
                "description": "Only these chains, by id or name: shufersal (שופרסל), rami-levy (רמי לוי), carrefour (קרפור), osher-ad (אושר עד), yohananof (יוחננוף), tiv-taam (טיב טעם), keshet (קשת טעמים).",
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 30
                }
              },
              "on_sale": {
                "description": "Only products with a deal open to everyone right now.",
                "type": "boolean"
              },
              "max_price": {
                "description": "Only products whose cheapest shelf price is at most this, in ₪.",
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 10000
              }
            }
          },
          "sort": {
            "description": "relevance (default), price (cheapest first), unit_price (per 100 g / 100 ml), discount (biggest deal first).",
            "type": "string",
            "enum": [
              "relevance",
              "price",
              "unit_price",
              "discount"
            ]
          },
          "limit": {
            "description": "How many products (default 8).",
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          }
        },
        "required": [
          "query"
        ]
      }
    },
    {
      "name": "find_deals",
      "title": "Find deals",
      "widget": true,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "query": {
            "description": "A product, kind or brand to find deals on (\"קפה\", \"חיתולים\", \"שטראוס\"). Omit for today's biggest deals on popular products.",
            "type": "string",
            "maxLength": 120
          },
          "location": {
            "description": "Where the user shops: prices differ by region. Pass it whenever the user said where they live or shop. Omitted, prices are for Tel Aviv & Gush Dan and the result says so.",
            "type": "object",
            "properties": {
              "city": {
                "description": "The city or town the user shops in, ideally in Hebrew as Israelis write it (\"רמת גן\", \"באר שבע\", \"מודיעין\"). English works for big cities.",
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "filters": {
            "description": "Optional narrowing.",
            "type": "object",
            "properties": {
              "chains": {
                "description": "Only these chains, by id or name: shufersal (שופרסל), rami-levy (רמי לוי), carrefour (קרפור), osher-ad (אושר עד), yohananof (יוחננוף), tiv-taam (טיב טעם), keshet (קשת טעמים).",
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 30
                }
              },
              "include_club_deals": {
                "description": "Count club-member and credit-card deals in the prices. Default false: only deals open to everyone are priced in; club deals are still shown.",
                "type": "boolean"
              }
            }
          },
          "limit": {
            "description": "How many deals (default 12).",
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          }
        }
      }
    },
    {
      "name": "find_stores",
      "title": "Find supermarket branches",
      "widget": true,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "location": {
            "description": "Where the user shops: prices differ by region. Pass it whenever the user said where they live or shop. Omitted, prices are for Tel Aviv & Gush Dan and the result says so.",
            "type": "object",
            "properties": {
              "city": {
                "description": "The city or town the user shops in, ideally in Hebrew as Israelis write it (\"רמת גן\", \"באר שבע\", \"מודיעין\"). English works for big cities.",
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "chains": {
            "description": "Only these chains, by id or name: shufersal (שופרסל), rami-levy (רמי לוי), carrefour (קרפור), osher-ad (אושר עד), yohananof (יוחננוף), tiv-taam (טיב טעם), keshet (קשת טעמים).",
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 30
            }
          },
          "limit": {
            "description": "How many branches (default 20).",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        }
      }
    },
    {
      "name": "get_product",
      "title": "Product details",
      "widget": true,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "product": {
            "description": "The product as a shopper says it, in Hebrew when possible, with brand, size and fat % when known: \"חלב תנובה 3% 1 ליטר\", \"במבה 80 גרם\", \"קוטג' 5%\", \"עגבניות\".",
            "type": "string",
            "maxLength": 120
          },
          "barcode": {
            "description": "A barcode (EAN/GTIN) when known, e.g. from an earlier result. Takes precedence over the text.",
            "type": "string",
            "maxLength": 20
          },
          "location": {
            "description": "Where the user shops: prices differ by region. Pass it whenever the user said where they live or shop. Omitted, prices are for Tel Aviv & Gush Dan and the result says so.",
            "type": "object",
            "properties": {
              "city": {
                "description": "The city or town the user shops in, ideally in Hebrew as Israelis write it (\"רמת גן\", \"באר שבע\", \"מודיעין\"). English works for big cities.",
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "include": {
            "description": "Sections to add (default all): regions (price in every region of Israel), history (price changes we recorded), alternatives (cheaper similar products), deals (current promotions).",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "regions",
                "history",
                "alternatives",
                "deals"
              ]
            }
          }
        }
      }
    },
    {
      "name": "get_coverage",
      "title": "Coverage and freshness",
      "widget": false,
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {}
      }
    }
  ],
  "instructions": "Agala (עגלה) compares Israeli supermarket prices using the price files chains must publish by law (Shufersal, Rami Levy, Carrefour, Osher Ad, Yohananof, Tiv Taam, Keshet Teamim), refreshed every morning.\n\nWhich tool:\n- One or a few products, \"where is it cheapest\" → compare_prices.\n- A shopping list, weekly shop or recipe → compare_cart, ALL items in ONE call, with quantities (kg for produce and meat).\n- Browse a kind of product, or resolve an ambiguous name → search_products.\n- Sales and promotions → find_deals. Branches in a city → find_stores. Price history, regions, alternatives → get_product. Coverage questions → get_coverage.\n\nAlways pass location.city when the user said where they shop; if they did not, call anyway and mention the prices are for Tel Aviv & Gush Dan, and ask for their city if they want local prices. Write product names in Hebrew as shoppers say them, with brand and size when known. Use any_brand: true when the user does not care about the brand.\n\nNever compute or guess prices yourself: quote the tool's numbers. Lead with the answer in one or two sentences (cheapest chain, the total or price, the saving) and let the card show the details; don't repeat the full table. Prices are per a reference branch in the region and can differ slightly in-store; mention it only if the user asks or plans a big shop. Do not recommend a chain beyond what the numbers show."
}