MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / build_tool

Function build_tool

bmtools/tools/airbnb/api.py:10–305  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

8
9
10def build_tool(config) -> Tool:
11 tool = Tool(
12 "Short-term rental and housing information",
13 "Look up rental and housing information",
14 name_for_model="Airbnb",
15 description_for_model="Plugin for look up rental and housing information",
16 logo_url="https://your-app-url.com/.well-known/logo.png",
17 contact_email="hello@contact.com",
18 legal_info_url="hello@legal.com"
19 )
20
21 BASE_URL = "https://airbnb19.p.rapidapi.com/api/v1"
22 KEY = config["subscription_key"]
23 HEADERS = {
24 "X-RapidAPI-Key": KEY,
25 "X-RapidAPI-Host": "airbnb19.p.rapidapi.com"
26 }
27
28
29 @tool.get("/ssearch_property")
30 def search_property(_id: str, display_name: Optional[str] = None,
31 total_records: Optional[str] = '10', currency: Optional[str] = 'USD',
32 offset: Optional[str] = None, category: Optional[str] = None,
33 adults: Optional[int] = 1, children: Optional[int] = None,
34 infants: Optional[int] = None, pets: Optional[int] = None,
35 checkin: Optional[str] = None, checkout: Optional[str] = None,
36 priceMin: Optional[int] = None, priceMax: Optional[int] = None,
37 minBedrooms: Optional[int] = None, minBeds: Optional[int] = None,
38 minBathrooms: Optional[int] = None, property_type: Optional[List[str]] = None,
39 host_languages: Optional[List[str]] = None, amenities: Optional[List[str]] = None,
40 type_of_place: Optional[List[str]] = None, top_tier_stays: Optional[List[str]] = None,
41 self_check_in: Optional[bool] = None, instant_book: Optional[bool] = None,
42 super_host: Optional[bool] = None, languageId: Optional[str] = None) -> dict:
43 """
44 This function takes various parameters to search properties on Airbnb.
45
46 Parameters:
47 api_key (str): The RapidAPI Key for Airbnb API.
48 id (str): The ID of the destination.
49 display_name (Optional[str]): The name of the destination.
50 total_records (Optional[str]): The number of records to be retrieved per API call.
51 currency (Optional[str]): The currency for the transaction.
52 offset (Optional[str]): The offset for the search result.
53 category (Optional[str]): The category of the properties.
54 adults (Optional[int]): The number of adults.
55 children (Optional[int]): The number of children.
56 infants (Optional[int]): The number of infants.
57 pets (Optional[int]): The number of pets.
58 checkin (Optional[str]): The check-in date.
59 checkout (Optional[str]): The check-out date.
60 priceMin (Optional[int]): The minimum price.
61 priceMax (Optional[int]): The maximum price.
62 minBedrooms (Optional[int]): The minimum number of bedrooms.
63 minBeds (Optional[int]): The minimum number of beds.
64 minBathrooms (Optional[int]): The minimum number of bathrooms.
65 property_type (Optional[List[str]]): The type of the property.
66 host_languages (Optional[List[str]]): The languages that the host can speak.
67 amenities (Optional[List[str]]): The amenities provided by the property.

Callers

nothing calls this directly

Calls 1

ToolClass · 0.50

Tested by

no test coverage detected