find-units
Find geological rock units, formations, bedrock geology, and mineral information for any location worldwide using latitude and longitude coordinates.
Instructions
Find geological rock units, formations, bedrock geology, and mineral information for any location worldwide. Use for geology questions, rock types, age dating, lithology, and geological analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | A valid latitude in decimal degrees | |
| lng | Yes | A valid longitude in decimal degrees | |
| responseType | No | The length of response long or short. Long provides lots of good details | long |
Implementation Reference
- src/index.ts:957-973 (handler)The handler function for the 'find-units' tool. It takes lat, lng, and optional responseType ('long' or 'short'), queries the Macrostrat units API, and returns the JSON data as text content.async (request) => { const { lat, lng, responseType } = request; const params = new URLSearchParams({ lat: lat.toString(), lng: lng.toString(), response: responseType, }); const response = await fetch(`${getApiEndpoint("units")}?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; }
- src/index.ts:948-956 (schema)The tool schema defining title, description, and inputSchema using Zod for validation of lat, lng (required numbers), and responseType (enum with default).{ title: "Find Units", description: "Find geological rock units, formations, bedrock geology, and mineral information for any location worldwide. Use for geology questions, rock types, age dating, lithology, and geological analysis.", inputSchema: { lat: z.number().describe("A valid latitude in decimal degrees"), lng: z.number().describe("A valid longitude in decimal degrees"), responseType: z.enum(["long", "short"]).default("long").describe("The length of response long or short. Long provides lots of good details"), } },
- src/index.ts:946-974 (registration)The server.registerTool call that registers the 'find-units' tool with its schema and inline handler function.server.registerTool( "find-units", { title: "Find Units", description: "Find geological rock units, formations, bedrock geology, and mineral information for any location worldwide. Use for geology questions, rock types, age dating, lithology, and geological analysis.", inputSchema: { lat: z.number().describe("A valid latitude in decimal degrees"), lng: z.number().describe("A valid longitude in decimal degrees"), responseType: z.enum(["long", "short"]).default("long").describe("The length of response long or short. Long provides lots of good details"), } }, async (request) => { const { lat, lng, responseType } = request; const params = new URLSearchParams({ lat: lat.toString(), lng: lng.toString(), response: responseType, }); const response = await fetch(`${getApiEndpoint("units")}?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } );