Skip to main content
Glama
devashish234073

my-mcp-server

weather_info

Retrieve mock weather data for a specific city using the weather_info tool on my-mcp-server. Input the city name to get weather information instantly.

Instructions

Get weather information for a city

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesThe city name

Implementation Reference

  • Handler for the 'weather_info' tool that provides mock weather information for specified cities using a hardcoded data map.
    case "weather_info": // Mock weather data (you could integrate with a real API) const weatherData = { "New York": "Sunny, 72°F", "London": "Cloudy, 65°F", "Tokyo": "Rainy, 68°F", "Sydney": "Partly cloudy, 75°F", }; const weather = weatherData[args.city] || "Weather data not available for this city"; return { content: [ { type: "text", text: `Weather in ${args.city}: ${weather}`, }, ], };
  • server1.js:54-67 (registration)
    Registration of the 'weather_info' tool in the listTools handler, including name, description, and input schema requiring a 'city' string.
    { name: "weather_info", description: "Get weather information for a city", inputSchema: { type: "object", properties: { city: { type: "string", description: "The city name", }, }, required: ["city"], }, }
  • Input schema for the 'weather_info' tool, defining a required 'city' string property.
    inputSchema: { type: "object", properties: { city: { type: "string", description: "The city name", }, }, required: ["city"], },

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/devashish234073/my-mcps'

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