Skip to main content
Glama
blake365

Macrostrat MCP Server

by blake365

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
NameRequiredDescriptionDefault
latYesA valid latitude in decimal degrees
lngYesA valid longitude in decimal degrees
responseTypeNoThe length of response long or short. Long provides lots of good detailslong

Implementation Reference

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

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