Skip to main content
Glama
WeatherXM

WeatherXM Pro MCP Server

Official
by WeatherXM

get_stations_in_cell

Retrieve WeatherXM station data within a specified H3 cell index to analyze localized weather conditions and enhance monitoring capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cell_indexYesThe H3 index of the cell to return stations for

Implementation Reference

  • The handler function executes the tool logic by making an API call to fetch stations within the specified H3 cell index from the WeatherXM API, handling success and error responses appropriately.
    async ({ cell_index }) => { try { const response = await axiosInstance.get(`/cells/${cell_index}/stations`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error: any) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `WeatherXM API error: ${error.response?.data.message ?? error.message}` }], isError: true, }; } throw error; } }
  • Zod schema defining the input parameter 'cell_index' as a string with description for validation.
    { cell_index: z.string().describe("The H3 index of the cell to return stations for"), },
  • src/index.ts:188-209 (registration)
    The MCP server.tool call that registers the 'get_stations_in_cell' tool, including its name, input schema, and handler function.
    server.tool( "get_stations_in_cell", { cell_index: z.string().describe("The H3 index of the cell to return stations for"), }, async ({ cell_index }) => { try { const response = await axiosInstance.get(`/cells/${cell_index}/stations`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error: any) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `WeatherXM API error: ${error.response?.data.message ?? error.message}` }], isError: true, }; } throw error; } } );

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/WeatherXM/weatherxm-pro-mcp'

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