Skip to main content
Glama
blake365

Macrostrat MCP Server

by blake365

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
NameRequiredDescriptionDefault
adjacentsNoInclude adjacent columns
latYesA valid latitude in decimal degrees
lngYesA valid longitude in decimal degrees
responseTypeYesThe length of response long or shortlong

Implementation Reference

  • 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) }] }; }
  • 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) }] }; } );
  • 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; }

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/blake365/macrostrat-mcp'

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