Skip to main content
Glama
blake365

Macrostrat MCP Server

by blake365

timescale

Retrieve geological time period information by entering an age in millions of years before present. This tool provides detailed data about specific geological eras from the Macrostrat database.

Instructions

Get information about a time period

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ageYesAge in millions of years before present

Implementation Reference

  • The handler function for the 'timescale' tool. It accepts an 'age' input, constructs a query to the Macrostrat API /v2/defs/intervals endpoint using timescale_id=11, fetches the data, and returns it as formatted JSON text.
    async (request) => { const { age } = request; const params = new URLSearchParams({ timescale_id: "11", age: age.toString(), }); const response = await fetch(`${getApiEndpoint("base")}/v2/defs/intervals?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; }
  • Input schema specification for the 'timescale' tool, including title, description, and required 'age' parameter (number).
    { title: "Timescale", description: "Get information about a time period", inputSchema: { age: z.number().describe("Age in millions of years before present"), } },
  • src/index.ts:1054-1079 (registration)
    Registration of the 'timescale' MCP tool using server.registerTool, including the tool name, schema, and handler function.
    server.registerTool( "timescale", { title: "Timescale", description: "Get information about a time period", inputSchema: { age: z.number().describe("Age in millions of years before present"), } }, async (request) => { const { age } = request; const params = new URLSearchParams({ timescale_id: "11", age: age.toString(), }); const response = await fetch(`${getApiEndpoint("base")}/v2/defs/intervals?${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