Skip to main content
Glama
blake365

Macrostrat MCP Server

by blake365

defs-autocomplete

Retrieve up to 100 geologic definitions matching a search query using the Macrostrat MCP Server for comprehensive geologic data access.

Instructions

Quickly retrieve all definitions matching a query. Limited to 100 results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesthe search term

Implementation Reference

  • The tool handler: extracts 'query' from request, fetches autocomplete data from Macrostrat API `/defs/autocomplete`, parses JSON, and returns formatted text content.
    async (request) => { const { query } = request; const params = new URLSearchParams({ query }); const response = await fetch(`${getApiEndpoint("base")}/defs/autocomplete?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; }
  • Tool schema defining title, description, and inputSchema with 'query' as required string using Zod validation.
    { title: "Definitions Autocomplete", description: "Quickly retrieve all definitions matching a query. Limited to 100 results", inputSchema: { query: z.string().describe("the search term"), } },
  • src/index.ts:1001-1023 (registration)
    Registration of the 'defs-autocomplete' tool using server.registerTool with schema and inline handler function.
    server.registerTool( "defs-autocomplete", { title: "Definitions Autocomplete", description: "Quickly retrieve all definitions matching a query. Limited to 100 results", inputSchema: { query: z.string().describe("the search term"), } }, async (request) => { const { query } = request; const params = new URLSearchParams({ query }); const response = await fetch(`${getApiEndpoint("base")}/defs/autocomplete?${params}`); const data = await response.json(); return { content: [{ type: "text" as const, 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