get_nearby_hotspots
Find birding hotspots near specific coordinates using eBird data. Specify location, search radius, and recent activity to discover optimal birdwatching sites.
Instructions
Get birding hotspots near a location.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude | |
| lng | Yes | Longitude | |
| back | No | Only hotspots visited in last N days | |
| dist | No | Search radius in kilometers | |
| fmt | No | Response format | json |
Implementation Reference
- src/index.ts:426-437 (handler)The asynchronous handler function for the 'get_nearby_hotspots' tool. It constructs query parameters from the input arguments (lat, lng, dist, fmt, and optional back), makes an HTTP request to the '/ref/hotspot/geo' endpoint using the makeRequest helper, and returns the result as a JSON-formatted text content block.async (args) => { const params: Record<string, string | number | boolean> = { lat: args.lat, lng: args.lng, dist: args.dist, fmt: args.fmt, }; if (args.back) params.back = args.back; const result = await makeRequest("/ref/hotspot/geo", params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:419-425 (schema)Zod input schema validating and describing the tool parameters: latitude, longitude, optional back days, distance radius (default 25km), and response format (json or csv, default json).{ lat: z.number().min(-90).max(90).describe("Latitude"), lng: z.number().min(-180).max(180).describe("Longitude"), back: z.number().min(1).max(30).optional().describe("Only hotspots visited in last N days"), dist: z.number().min(0).max(500).default(25).describe("Search radius in kilometers"), fmt: z.enum(["json", "csv"]).default("json").describe("Response format"), },
- src/index.ts:417-438 (registration)The server.tool() call that registers the 'get_nearby_hotspots' tool with its name, description, input schema, and handler function."get_nearby_hotspots", "Get birding hotspots near a location.", { lat: z.number().min(-90).max(90).describe("Latitude"), lng: z.number().min(-180).max(180).describe("Longitude"), back: z.number().min(1).max(30).optional().describe("Only hotspots visited in last N days"), dist: z.number().min(0).max(500).default(25).describe("Search radius in kilometers"), fmt: z.enum(["json", "csv"]).default("json").describe("Response format"), }, async (args) => { const params: Record<string, string | number | boolean> = { lat: args.lat, lng: args.lng, dist: args.dist, fmt: args.fmt, }; if (args.back) params.back = args.back; const result = await makeRequest("/ref/hotspot/geo", params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } );