list_nodit_api_categories
Retrieve available API categories to access normalized blockchain data from multiple networks, enabling AI applications to process real-time blockchain information.
Instructions
Lists available Nodit API categories from Nodit Blockchain Context. To use the Nodit API tool, you must first call this tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/api-categories.ts:113-171 (handler)The inline handler for the 'list_nodit_api_categories' tool. It constructs a list of API categories (Node API, Data API, Aptos Indexer API, Webhook API), formats their descriptions and supported chains/networks using pre-defined maps, and returns a formatted text response with service description and usage guide.server.tool("list_nodit_api_categories", "Lists available Nodit API categories from Nodit Blockchain Context. To use the Nodit API tool, you must first call this tool.", {}, async () => { const toolName = "list_nodit_api_categories"; try { const categories = [ { name: "Nodit Node API", description: "Nodit Blockchain Context provides through shared node endpoints operated reliably by Nodit's professional technical team, you can immediately call blockchain Node APIs to query real-time network changes and send transactions without separate infrastructure operations personnel.", supportedChains: Array.from(nodeApiChains).sort() }, { name: "Nodit Data API", description: "Nodit Blockchain Context provides blockchain data collected by Nodit's professional technical team, it provides query APIs that allow access to meticulously indexed blockchain data that is immediately usable without complex separate blockchain data ETL operations.", supportedChains: Array.from(dataApiChains).sort() }, { name: "Nodit Aptos Indexer API", description: "Nodit Blockchain Context provides a GraphQL API for accessing indexed data from the Aptos blockchain. This API allows you to query various blockchain data such as coin activities, token activities, and more without having to set up and maintain your own indexer.", supportedChains: ["aptos"] }, { name: "Nodit Webhook API", description: "Nodit Webhook is a development tool that helps you implement responsive applications for real-time events by sending event occurrence information to the URL registered in the Webhook when a defined on-chain event occurs. You can receive information in real time when important events occur, such as a new transaction occurring on the blockchain or a change in the smart contract status.", supportedChains: Array.from(webhookApiChains).sort() }, ]; const formattedList = categories.map(category => { let networkInfo = ''; let networkMap; if (category.name === "Nodit Node API") { networkMap = nodeApiNetworks; } else if (category.name === "Nodit Data API") { networkMap = dataApiNetworks; } else if (category.name === "Nodit Aptos Indexer API") { networkMap = aptosApiNetworks; } else if (category.name === "Nodit Webhook API") { networkMap = webhookApiNetworks; } if (networkMap) { networkInfo = category.supportedChains .filter(chain => networkMap[chain]) .map(chain => ` - ${chain}: ${networkMap[chain].join(', ')}`) .join('\n'); } return ` - name: ${category.name}, description: ${category.description} supported chain and network: ${networkInfo}`; }).join("\n"); const content = `${noditServiceDescription} ${guideToUseNodit} - Available Nodit API Categories: ${formattedList} ` return { content: [{ type: "text", text: content }] }; } catch (error) { return createErrorResponse(`Failed to list categories: ${(error as Error).message}`, toolName); } });
- src/tools/api-categories.ts:76-172 (registration)The registerApiCategoriesTools function loads Nodit API specs, parses supported chains for each category, defines network maps, and registers the 'list_nodit_api_categories' tool with its handler.export function registerApiCategoriesTools(server: McpServer) { const noditDataApiSpec: NoditOpenApiSpecType = loadNoditDataApiSpec(); const noditNodeApiSpecMap: Map<string, NoditOpenApiSpecType> = loadNoditNodeApiSpecMap(); const noditWebhookApiSpec: NoditOpenApiSpecType = loadNoditWebhookApiSpec() const dataApiChains = new Set<string>(); Object.values(noditDataApiSpec.paths).forEach(pathItem => { if (pathItem?.post?.parameters) { const chainParam = pathItem.post.parameters.find((param: any) => param.name === 'chain'); if (chainParam?.schema?.enum) { chainParam.schema.enum.forEach((chain: string) => dataApiChains.add(chain)); } } }); const nodeApiChains = new Set<string>(); nodeApiChains.add('ethereum'); Array.from(noditNodeApiSpecMap.entries()).forEach(([operationId]) => { if (operationId.includes('-')) { const chain = operationId.split('-')[0]; nodeApiChains.add(chain); } }); const webhookApiChains = new Set<string>(); webhookApiChains.add('aptos'); Object.values(noditWebhookApiSpec.paths).forEach(pathItem => { if (pathItem?.post?.parameters) { const chainParam = pathItem.post.parameters.find((param: any) => param.name === 'chain'); if (chainParam?.schema?.enum) { chainParam.schema.enum.forEach((chain: string) => webhookApiChains.add(chain)); } } }); server.tool("list_nodit_api_categories", "Lists available Nodit API categories from Nodit Blockchain Context. To use the Nodit API tool, you must first call this tool.", {}, async () => { const toolName = "list_nodit_api_categories"; try { const categories = [ { name: "Nodit Node API", description: "Nodit Blockchain Context provides through shared node endpoints operated reliably by Nodit's professional technical team, you can immediately call blockchain Node APIs to query real-time network changes and send transactions without separate infrastructure operations personnel.", supportedChains: Array.from(nodeApiChains).sort() }, { name: "Nodit Data API", description: "Nodit Blockchain Context provides blockchain data collected by Nodit's professional technical team, it provides query APIs that allow access to meticulously indexed blockchain data that is immediately usable without complex separate blockchain data ETL operations.", supportedChains: Array.from(dataApiChains).sort() }, { name: "Nodit Aptos Indexer API", description: "Nodit Blockchain Context provides a GraphQL API for accessing indexed data from the Aptos blockchain. This API allows you to query various blockchain data such as coin activities, token activities, and more without having to set up and maintain your own indexer.", supportedChains: ["aptos"] }, { name: "Nodit Webhook API", description: "Nodit Webhook is a development tool that helps you implement responsive applications for real-time events by sending event occurrence information to the URL registered in the Webhook when a defined on-chain event occurs. You can receive information in real time when important events occur, such as a new transaction occurring on the blockchain or a change in the smart contract status.", supportedChains: Array.from(webhookApiChains).sort() }, ]; const formattedList = categories.map(category => { let networkInfo = ''; let networkMap; if (category.name === "Nodit Node API") { networkMap = nodeApiNetworks; } else if (category.name === "Nodit Data API") { networkMap = dataApiNetworks; } else if (category.name === "Nodit Aptos Indexer API") { networkMap = aptosApiNetworks; } else if (category.name === "Nodit Webhook API") { networkMap = webhookApiNetworks; } if (networkMap) { networkInfo = category.supportedChains .filter(chain => networkMap[chain]) .map(chain => ` - ${chain}: ${networkMap[chain].join(', ')}`) .join('\n'); } return ` - name: ${category.name}, description: ${category.description} supported chain and network: ${networkInfo}`; }).join("\n"); const content = `${noditServiceDescription} ${guideToUseNodit} - Available Nodit API Categories: ${formattedList} ` return { content: [{ type: "text", text: content }] }; } catch (error) { return createErrorResponse(`Failed to list categories: ${(error as Error).message}`, toolName); } }); }
- src/tools/index.ts:11-11 (registration)In registerAllTools, calls registerApiCategoriesTools to register the api categories tools including 'list_nodit_api_categories'.registerApiCategoriesTools(server);