MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / verify

Method verify

plugin/bundles/open_weather/bundle.py:8–26  ·  view source on GitHub ↗
(self, credentials: BundleCredentials)

Source from the content-addressed store, hash-verified

6class OpenWeather(BundleHandler):
7
8 async def verify(self, credentials: BundleCredentials):
9 # todo: implement with actual verification logic
10 lat: float = 30.25
11 lon: float = 120.166
12
13 base_url = "https://api.openweathermap.org/data/3.0/onecall"
14 params = {
15 'lat': lat,
16 'lon': lon,
17 'exclude': 'minutely,hourly,daily,alerts',
18 'appid': credentials.credentials.get("OPEN_WEATHER_API_KEY", ""),
19 'units': 'metric'
20 }
21 async with ClientSession() as session:
22 async with session.get(base_url, params=params) as response:
23 if response.status == 200:
24 pass
25 else:
26 raise_credentials_validation_error()
27
28
29

Callers

nothing calls this directly

Calls 2

getMethod · 0.45

Tested by

no test coverage detected