Skip to main content
Glama
blake365

Macrostrat MCP Server

by blake365

timescale

Retrieve detailed information about geologic time periods by specifying an age. This tool accesses the Macrostrat API to provide accurate geologic data for analysis and research.

Instructions

Get information about a time period

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ageNo

Implementation Reference

  • src/index.ts:1054-1079 (registration)
    Registration of the 'timescale' MCP tool, including title, description, input schema, and inline 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) }] }; } );
  • The handler function for the 'timescale' tool. It accepts an 'age' parameter, constructs a query for timescale_id '11', fetches intervals data from the Macrostrat API, and returns the JSON response as text content.
    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 for the 'timescale' tool, defining the required 'age' parameter as a number representing millions of years before present.
    inputSchema: { age: z.number().describe("Age in millions of years before present"), }
  • build/index.js:914-934 (registration)
    Compiled registration of the 'timescale' MCP tool in the built JavaScript version.
    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", text: JSON.stringify(data, null, 2) }] }; });

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