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}` }] };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Lists' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, returns paginated results, or provides any metadata about the query roots. The description is minimal and lacks important behavioral context.

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

Conciseness5/5

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

The description is a single, clear sentence that states exactly what the tool does with no unnecessary words. It's front-loaded with the core purpose and efficiently communicates the essential information without any fluff or redundancy.

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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the results will be in, whether it returns structured data about query roots, or what the user can expect from the output. Given the complexity of GraphQL API exploration, more context about the return value would be helpful.

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

Parameters4/5

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

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and the schema already fully documents this. No additional parameter information is needed or provided.

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

Purpose4/5

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

The description clearly states the action ('Lists') and resource ('all query roots available in the Nodit Aptos Indexer GraphQL API'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_nodit_api_categories' or 'list_nodit_data_apis', which appear to serve similar listing functions in different contexts.

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 provides no guidance on when to use this tool versus alternatives. Given the sibling tools include multiple 'list_' operations and API call tools, there's no indication of when this specific listing is appropriate versus other listing tools or when direct API calls might be preferred.

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

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