Skip to main content
Glama
Moe03

Google Maps MCP Server

by Moe03

get_weather

Retrieve current weather conditions for any location by providing a city, address, or other details using Google Maps MCP Server functionality.

Instructions

Gets the current weather.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYesThe location to get weather for (city, address, etc.)

Implementation Reference

  • The handler function that implements the get_weather tool logic, returning mock weather data for the given location.
    async function handleGetWeather(location: string) { return { content: [{ type: "text", text: `Weather in ${location}: Sunny, 75 degrees Fahrenheit.` }], isError: false }; }
  • Defines the tool schema including name, description, and input validation schema requiring a 'location' string.
    const GET_WEATHER_TOOL: Tool = { name: "get_weather", description: "Gets the current weather.", inputSchema: { type: "object", properties: { location: { type: "string", description: "The location to get weather for (city, address, etc.)" } }, required: ["location"] }, };
  • src/index.ts:77-82 (registration)
    Registers the get_weather tool (via GET_WEATHER_TOOL) in the array of available tools returned by the listTools handler.
    const SIMPLE_TOOLS = [ GET_WEATHER_TOOL, ADD_POST_TOOL, GET_POSTS_TOOL, DELETE_POST_TOOL, ] as const;
  • src/index.ts:181-184 (registration)
    Registers the dispatch from CallToolRequest for 'get_weather' to the handleGetWeather function.
    case "get_weather": { const { location } = request.params.arguments as { location: string }; return await handleGetWeather(location); }

Other Tools

Related Tools

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/Moe03/mcp-hello-world'

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