search_cells_in_region
Locate specific weather data cells within a region by entering the region name with WeatherXM Pro MCP Server’s tool, streamlining precise data retrieval.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region_query | Yes | The name of the region to search for cells |
Implementation Reference
- src/index.ts:167-184 (handler)Handler function for the 'search_cells_in_region' tool. Makes an API call to '/cells/search' with the region_query parameter and returns the JSON response or an error.async ({ region_query }) => { try { const response = await axiosInstance.get('/cells/search', { params: { query: region_query }, }); 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; } }
- src/index.ts:164-166 (schema)Input schema for the 'search_cells_in_region' tool, defining the 'region_query' parameter as a string.{ region_query: z.string().describe("The name of the region to search for cells"), },
- src/index.ts:162-185 (registration)Registration of the 'search_cells_in_region' MCP tool using server.tool, including schema and handler.server.tool( "search_cells_in_region", { region_query: z.string().describe("The name of the region to search for cells"), }, async ({ region_query }) => { try { const response = await axiosInstance.get('/cells/search', { params: { query: region_query }, }); 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; } } );