find-columns
Locate geological stratigraphic columns and rock layers globally using latitude and longitude. Analyze bedrock, formations, and geological history for research or exploration purposes. Supports adjacent column inclusion and customizable response lengths.
Instructions
Find geological stratigraphic columns, rock layers, and geological history for any location worldwide. Use for geology, bedrock, formations, age dating, and stratigraphic analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adjacents | No | Include adjacent columns | |
| lat | Yes | A valid latitude in decimal degrees | |
| lng | Yes | A valid longitude in decimal degrees | |
| responseType | Yes | The length of response long or short | long |
Implementation Reference
- src/index.ts:926-943 (handler)The async handler function for the 'find-columns' tool. It takes lat, lng, optional adjacents and responseType, constructs query params, fetches data from Macrostrat columns API endpoint, and returns the JSON response as text content.async (request) => { const { lat, lng, adjacents, responseType } = request; const params = new URLSearchParams({ lat: lat.toString(), lng: lng.toString(), adjacents: adjacents?.toString() ?? "false", response: responseType, }); const response = await fetch(`${getApiEndpoint("columns")}?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; }
- src/index.ts:919-924 (schema)Zod input schema for the 'find-columns' tool defining validation for lat (number), lng (number), adjacents (optional boolean), and responseType (enum ["long", "short"], default "long").inputSchema: { lat: z.number().describe("A valid latitude in decimal degrees"), lng: z.number().describe("A valid longitude in decimal degrees"), adjacents: z.boolean().optional().describe("Include adjacent columns"), responseType: z.enum(["long", "short"]).default("long").describe("The length of response long or short"), }
- src/index.ts:914-944 (registration)McpServer registration of the 'find-columns' tool, specifying name, metadata (title, description, inputSchema), and the handler function.server.registerTool( "find-columns", { title: "Find Columns", description: "Find geological stratigraphic columns, rock layers, and geological history for any location worldwide. Use for geology, bedrock, formations, age dating, and stratigraphic analysis.", inputSchema: { lat: z.number().describe("A valid latitude in decimal degrees"), lng: z.number().describe("A valid longitude in decimal degrees"), adjacents: z.boolean().optional().describe("Include adjacent columns"), responseType: z.enum(["long", "short"]).default("long").describe("The length of response long or short"), } }, async (request) => { const { lat, lng, adjacents, responseType } = request; const params = new URLSearchParams({ lat: lat.toString(), lng: lng.toString(), adjacents: adjacents?.toString() ?? "false", response: responseType, }); const response = await fetch(`${getApiEndpoint("columns")}?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } );
- src/index.ts:648-670 (helper)Helper function getApiEndpoint that returns the Macrostrat API base URL for 'columns' type, used by the find-columns handler to construct the fetch URL.function getApiEndpoint(type: "mapUnits" | "units" | "columns" | "base"): string { const endpoint = ROOTS.find((root) => { if (root.type !== "api") return false; switch (type) { case "mapUnits": return root.uri === "https://macrostrat.org/api/geologic_units/map"; case "units": return root.uri === "https://macrostrat.org/api/units"; case "columns": return root.uri === "https://macrostrat.org/api/columns"; case "base": return root.uri === "https://macrostrat.org/api"; default: return false; } }); if (!endpoint) { throw new Error(`API endpoint not found for type: ${type}`); } return endpoint.uri; }