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
| Name | Required | Description | Default |
|---|---|---|---|
| age | No |
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) }] }; } );
- src/index.ts:1063-1077 (handler)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) }] };
- src/index.ts:1059-1061 (schema)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) }] }; });