Skip to main content
Glama

get_current_weather

Retrieve real-time weather data for a specified city using this tool. Integrates with Multi-MCPs to fetch accurate weather information quickly and efficiently.

Instructions

Get current weather by city name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYesCity name, e.g., London

Implementation Reference

  • The handler function for the get_current_weather tool. It validates the API key and location, then delegates to OpenWeatherClient.currentWeatherByCity.
    async get_current_weather(args: Record<string, unknown>) { if (!cfg.openWeatherApiKey) throw new Error("OPENWEATHER_API_KEY is not configured"); const location = String(args.location || ""); if (!location) throw new Error("location is required"); return client.currentWeatherByCity(location); },
  • The tool schema definition for get_current_weather, including name, description, and input schema requiring a 'location' string.
    { name: "get_current_weather", description: "Get current weather by city name", inputSchema: { type: "object", properties: { location: { type: "string", description: "City name, e.g., London" }, }, required: ["location"], }, },
  • Registration of tool sets in registerAllTools, including the OpenWeather registration which provides the get_current_weather tool.
    const registrations: ToolRegistration[] = [ registerOpenWeather(), registerGoogleMaps(), registerNewsApi(), registerGitHub(), registerNotion(), registerTrello(), registerSpotify(), registerTwilio(), registerUnsplash(), registerCoinGecko(), ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TaylorChen/muti-mcps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server