MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / WeatherTool

Class WeatherTool

examples/06_tool_schema_demo.py:24–55  ·  view source on GitHub ↗

Example weather tool.

Source from the content-addressed store, hash-verified

22
23
24class WeatherTool(Tool):
25 """Example weather tool."""
26
27 @property
28 def name(self) -> str:
29 return "get_weather"
30
31 @property
32 def description(self) -> str:
33 return "Get current weather information for a location. Returns temperature and conditions."
34
35 @property
36 def parameters(self) -> dict[str, Any]:
37 return {
38 "type": "object",
39 "properties": {
40 "location": {
41 "type": "string",
42 "description": "City and state, e.g. 'San Francisco, CA' or 'London, UK'",
43 },
44 "unit": {
45 "type": "string",
46 "enum": ["celsius", "fahrenheit"],
47 "description": "Temperature unit (celsius or fahrenheit)",
48 },
49 },
50 "required": ["location"],
51 }
52
53 async def execute(self, **kwargs) -> ToolResult:
54 """Mock execute method."""
55 return ToolResult(success=True, content="Weather data")
56
57
58class SearchTool(Tool):

Callers 2

demo_tool_schemasFunction · 0.85
demo_tool_schema_methodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected