{
  "name": "check_availability",
  "description": "Check which table times are actually free. You MUST call this before offering any time to a caller. Never guess whether a slot is free, never estimate from how busy we usually are, and never offer a time this tool did not return. If it returns nothing free, offer the nearest day that has something, and if the caller doesn't want that, take a message with capture_lead.",
  "speak_during_execution": true,
  "speak_after_execution": false,
  "execution_message_description": "A short natural line to say while this runs, e.g. 'Let me have a look for you.'",
  "parameters": {
    "type": "object",
    "properties": {
      "date": {
        "type": "string",
        "description": "The date the caller wants, as YYYY-MM-DD, resolved to the restaurant's local timezone. Resolve relative words ('tomorrow', 'this Friday') yourself before calling."
      },
      "time": {
        "type": "string",
        "description": "The time the caller asked for, 24-hour HH:MM. If they gave a vague time ('evening', 'around eight'), pick the most likely exact time and let the alternatives in the response correct it."
      },
      "party_size": {
        "type": "integer",
        "minimum": 1,
        "description": "Number of people. If this is above the client's max self-serve party size, do NOT call this tool — go to the large-party escalation instead."
      },
      "seating_preference": {
        "type": "string",
        "enum": ["indoor", "outdoor", "private_room", "no_preference"],
        "default": "no_preference",
        "description": "Only set this if the caller asked for it. Do not ask about seating — it costs a turn."
      }
    },
    "required": ["date", "time", "party_size"]
  },
  "response_schema": {
    "type": "object",
    "properties": {
      "requested_slot_available": { "type": "boolean" },
      "alternatives": {
        "type": "array",
        "description": "Real free slots, nearest first. Offer at most two out loud — one earlier and one later where possible.",
        "items": {
          "type": "object",
          "properties": {
            "date": { "type": "string" },
            "time": { "type": "string" },
            "seating": { "type": "string" }
          }
        }
      },
      "error": {
        "type": "string",
        "description": "Present only on failure. If this is set, tell the caller you're having trouble checking right now and take their details with capture_lead. Do not invent availability."
      }
    }
  },
  "_notes": {
    "integration_pattern": "API_CONTRACT.md §2 pattern 1 (platform-native Cal.com / Google Calendar tool) preferred. This definition is the spec for configuring it, and the fallback shape for pattern 2 (Cal.com API via n8n).",
    "timezone": "Pinned in platform calendar config from knowledge pack §A. Never passed per-call.",
    "qa": "Exercised by TEST_PLAN.md cases 1, 2, 9, 15."
  }
}
