Skip to main content
Glama
blake365

Macrostrat MCP Server

by blake365

Definitions

defs

Query standardized geologic dictionaries and fields from Macrostrat, including lithologies, structures, minerals, timescales, and stratigraphic data through API endpoints.

Instructions

Routes giving access to standard fields and dictionaries used in Macrostrat

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesThe endpoint to query
parametersYesparameters to pass to the endpoint

Implementation Reference

  • src/index.ts:976-999 (registration)
    Registration of the MCP tool named 'defs' which provides access to Macrostrat definitions endpoints
    server.registerTool(
      "defs",
      {
        title: "Definitions",
        description: "Routes giving access to standard fields and dictionaries used in Macrostrat",
        inputSchema: {
          endpoint: z.enum(["lithologies", "structures", "columns", "econs", "minerals", "timescales", "environments", "strat_names", "measurements", "intervals"]).describe("The endpoint to query"),
          parameters: z.string().describe("parameters to pass to the endpoint"),
        }
      },
      async (request) => {
        const { endpoint, parameters } = request;
        const params = new URLSearchParams(parameters);
        const response = await fetch(`${getApiEndpoint("base")}/defs/${endpoint}?${params}`);
        const data = await response.json();
    
        return {
          content: [{
            type: "text" as const,
            text: JSON.stringify(data, null, 2)
          }]
        };
      }
    );
  • Handler function that extracts endpoint and parameters, constructs query to Macrostrat API /defs/{endpoint}, fetches JSON response, and returns formatted text content
    async (request) => {
      const { endpoint, parameters } = request;
      const params = new URLSearchParams(parameters);
      const response = await fetch(`${getApiEndpoint("base")}/defs/${endpoint}?${params}`);
      const data = await response.json();
    
      return {
        content: [{
          type: "text" as const,
          text: JSON.stringify(data, null, 2)
        }]
      };
    }
  • Tool metadata including title, description, and Zod input schema defining 'endpoint' enum and 'parameters' string
    {
      title: "Definitions",
      description: "Routes giving access to standard fields and dictionaries used in Macrostrat",
      inputSchema: {
        endpoint: z.enum(["lithologies", "structures", "columns", "econs", "minerals", "timescales", "environments", "strat_names", "measurements", "intervals"]).describe("The endpoint to query"),
        parameters: z.string().describe("parameters to pass to the endpoint"),
      }
    },
  • Helper function getApiEndpoint used by defs handler to resolve base API URL for defs endpoints
    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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'Routes giving access,' suggesting a read-only operation, but doesn't specify if it's a query, retrieval, or list action, nor does it cover aspects like rate limits, authentication needs, or response format. The description is too minimal to adequately inform behavior beyond basic access.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function. It's front-loaded with the core purpose, though it could be more specific. There's no wasted text, making it appropriately concise for a simple tool, but it lacks depth that might be needed for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 2 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., data formats, structure) or provide behavioral context like error handling. For a tool accessing multiple endpoints, more detail on usage and outcomes is necessary to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear docs for 'endpoint' (including enum values) and 'parameters.' The description adds no additional meaning beyond the schema, such as explaining what 'parameters' might include or how endpoints differ. Baseline score of 3 is appropriate as the schema handles parameter documentation effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Routes giving access to standard fields and dictionaries used in Macrostrat,' which clarifies it provides access to data resources. However, it's vague about the specific action (e.g., querying, retrieving, or listing) and doesn't differentiate from siblings like 'defs-autocomplete' or 'mineral-info,' which may offer similar data access. The purpose is understandable but lacks precision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'defs-autocomplete' for autocomplete features or 'mineral-info' for specific mineral data, leaving the agent without context for selection. Usage is implied only through the endpoint parameter, but no explicit when/when-not instructions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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