Skip to main content
Glama
Moe03

Google Maps MCP Server

by Moe03

get_weather

Retrieve current weather conditions for any specified location using Google Maps data. Provide a city or address to get temperature, precipitation, and atmospheric details.

Instructions

Gets the current weather.

Input Schema

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

Implementation Reference

  • The main handler function for the get_weather tool, which returns a simulated weather response for the given location.
    async function handleGetWeather(location: string) { return { content: [{ type: "text", text: `Weather in ${location}: Sunny, 75 degrees Fahrenheit.` }], isError: false }; }
  • The schema definition for the get_weather tool, specifying name, description, and input schema requiring a 'location' parameter.
    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)
    Registration of the get_weather tool (as GET_WEATHER_TOOL) in the array of available tools returned by listTools.
    const SIMPLE_TOOLS = [ GET_WEATHER_TOOL, ADD_POST_TOOL, GET_POSTS_TOOL, DELETE_POST_TOOL, ] as const;
  • src/index.ts:181-184 (registration)
    Registration in the CallToolRequest handler switch statement, dispatching get_weather calls to the handler.
    case "get_weather": { const { location } = request.params.arguments as { location: string }; return await handleGetWeather(location); }
Install Server

Other 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