{
  "openapi": "3.0.0",
  "info": {
    "title": "Monihan Realty Property API",
    "version": "1.0.0",
    "description": "Returns rental property availability and details for Monihan Realty Inc."
  },
  "servers": [
    {
      "url": "https://api.monihan.com"
    }
  ],
  "paths": {
    "/rtr_api.php": {
      "get": {
        "operationId": "searchProperties",
        "summary": "Search rental properties by street, date, bedrooms, or sleeps. Whenever the visitor gives a property address or street TOGETHER WITH any date, week, or year (including future years like 2027), you MUST call this tool with both the street and the date - do NOT answer with only a rental.php property link, and do NOT guess availability. Always include the date parameter when any date or week is mentioned. Convert the mentioned date to the nearest Saturday in YYYY-MM-DD format.",
        "parameters": [
          {
            "name": "street",
            "in": "query",
            "required": false,
            "description": "Street name or property name to search for. Never pass a property/listing ID number (5-6 digit numbers like 134468) - IDs cannot be searched. If the visitor gives only a property number, ask them for the street address instead.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Check-in date in YYYY-MM-DD format (Saturday dates only)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "bedrooms",
            "in": "query",
            "required": false,
            "description": "Minimum number of bedrooms",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sleeps",
            "in": "query",
            "required": false,
            "description": "Minimum number of people the property must sleep",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pets",
            "in": "query",
            "required": false,
            "description": "Set to true if visitor is asking about pet-friendly properties only",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching properties with availability",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "properties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "street": {
                            "type": "string"
                          },
                          "bedrooms": {
                            "type": "integer"
                          },
                          "baths": {
                            "type": "number"
                          },
                          "sleeps": {
                            "type": "integer"
                          },
                          "amenities": {
                            "type": "string"
                          },
                          "availability": {},
                          "search_url": {
                            "type": "string",
                            "description": "Link to full search results on monihan.com"
                          },
                          "note": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "description": "IMPORTANT: This tool is the only source of real availability and rates. If the visitor names a property or street AND any date/week/year, call this tool with street + date rather than just sending the rental.php link - the property page does not show future-year weeks. Always pass the date parameter when the visitor mentions any date, week, or time period, converted to the nearest Saturday in YYYY-MM-DD format. Never call this tool without date if the visitor mentioned one. Use the availability, weekly_rate, and owner_confirm fields in the response to answer. When no street is given, the response is a SAMPLE of up to 5 properties, not the complete list - check total_available_count for the true number available and tell the visitor there may be more, never say a sampled property is \"the only one\" available."
      }
    },
    "/agent_lookup.php": {
      "get": {
        "operationId": "lookupAgent",
        "summary": "Look up a Monihan Realty agent by name to get their real email address and phone extension. Call this ANY time a visitor asks for a specific agent contact/email by name. NEVER construct, guess, or pattern-match an email address yourself - always call this tool and use exactly what it returns. If it returns match=none, do not provide any email; ask the visitor to confirm the agent name or route to the office. If it returns match=fuzzy, tell the visitor this is your best match and confirm the name before treating the email as certain. The response includes an extension field when available - use it for phone extension questions. Do NOT call this tool when a visitor is giving their OWN name and phone number in response to being asked for contact info - that is a lead, not an agent lookup, and should just be acknowledged and passed along normally. Only call this tool when the visitor is asking about a specific agent by name.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "description": "The agent name as given by the visitor (first and/or last name).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent match result"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  }
}