Skip to main content
Glama

list_nodit_aptos_indexer_api_query_root

Discover available query roots for accessing Aptos blockchain data through the Nodit Indexer GraphQL API, enabling structured data retrieval for AI applications.

Instructions

Lists all query roots available in the Nodit Aptos Indexer GraphQL API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that loads the Nodit Aptos Indexer API specification, iterates over sources and tables to collect custom_name query roots, sorts them, and returns a formatted text list. Handles errors with createErrorResponse.
    async () => { const toolName = "list_nodit_aptos_indexer_api_query_root"; try { if (!noditAptosIndexerApiSpec || !noditAptosIndexerApiSpec.metadata || !noditAptosIndexerApiSpec.metadata.sources) { return createErrorResponse("Failed to load or parse the Aptos Indexer API schema", toolName); } const queryRoots: string[] = []; for (const source of noditAptosIndexerApiSpec.metadata.sources) { if (source.tables) { for (const tableInfo of source.tables) { if (tableInfo.configuration && tableInfo.configuration.custom_name) { queryRoots.push(tableInfo.configuration.custom_name); } } } } if (queryRoots.length === 0) { return createErrorResponse("No query roots found in the Aptos Indexer API schema", toolName); } queryRoots.sort(); const resultText = `Available Aptos Indexer API query roots:\n\n${queryRoots.join('\n')}`; return { content: [{ type: "text", text: resultText }] }; } catch (error) { return createErrorResponse(`Error processing Aptos Indexer API schema: ${(error as Error).message}`, toolName); } }
  • Registers the tool with the MCP server using server.tool(), providing name, description, empty input schema, and the handler function.
    server.tool( "list_nodit_aptos_indexer_api_query_root", "Lists all query roots available in the Nodit Aptos Indexer GraphQL API.", {}, async () => { const toolName = "list_nodit_aptos_indexer_api_query_root"; try { if (!noditAptosIndexerApiSpec || !noditAptosIndexerApiSpec.metadata || !noditAptosIndexerApiSpec.metadata.sources) { return createErrorResponse("Failed to load or parse the Aptos Indexer API schema", toolName); } const queryRoots: string[] = []; for (const source of noditAptosIndexerApiSpec.metadata.sources) { if (source.tables) { for (const tableInfo of source.tables) { if (tableInfo.configuration && tableInfo.configuration.custom_name) { queryRoots.push(tableInfo.configuration.custom_name); } } } } if (queryRoots.length === 0) { return createErrorResponse("No query roots found in the Aptos Indexer API schema", toolName); } queryRoots.sort(); const resultText = `Available Aptos Indexer API query roots:\n\n${queryRoots.join('\n')}`; return { content: [{ type: "text", text: resultText }] }; } catch (error) { return createErrorResponse(`Error processing Aptos Indexer API schema: ${(error as Error).message}`, toolName); } } );
  • Top-level registration call within registerAllTools that invokes the module-specific registration function.
    registerAptosIndexerTools(server);
  • Helper utility that loads the static Aptos Indexer API schema JSON file, which is parsed and used by the tool handler to extract query roots.
    export function loadNoditAptosIndexerApiSpec(): AptosIndexerApiSpec { const schemaPath = path.resolve(__dirname, '../nodit-aptos-indexer-api-schema.json'); return loadOpenapiSpecFile(schemaPath) as AptosIndexerApiSpec; }
  • Utility function used by the handler to format and return standardized error responses.
    export function createErrorResponse(message: string, toolName: string): { content: { type: "text"; text: string }[] } { log(`Tool Error (${toolName}): ${message}`); return { content: [{ type: "text" as const, text: `Tool Error: ${message}` }] }; }

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/noditlabs/nodit-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server