Skip to main content
Glama

list_nodit_webhook_apis

Discover available webhook API operations for accessing normalized, multi-chain blockchain data through the Nodit MCP Server.

Instructions

Lists available Nodit Webhook API operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler logic: loads the OpenAPI spec, extracts all HTTP methods' operations across paths, determines supported chains, formats a markdown-like list of operationIds with descriptions and chains, returns structured text response. Precomputes the list at registration time.
        const noditWebhookApiSpec: NoditOpenApiSpecType = loadNoditWebhookApiSpec()
    
        const apis = Object.values(noditWebhookApiSpec.paths).flatMap((pathItem) => {
            return [pathItem.get, pathItem.post, pathItem.put, pathItem.patch, pathItem.delete].filter((item) => item !== undefined).map((item) => {
                if (item && item.operationId) {
                    const operationId = item.operationId;
                    const description = item.description;
                    const chains = item.parameters?.find((param) => param.name === "chain")?.schema?.enum ?? ["aptos"];
    
                    return {
                        operationId,
                        description,
                        chains
                    }
                }
            })
        }).filter((api) => api !== undefined);
        
        server.tool(toolName, "Lists available Nodit Webhook API operations.", {}, () => {
            try {
                const formattedList = apis
                    .map(api => `  - operationId: ${api.operationId}, supported chains: [${api.chains.join(',')}], description: ${api.description}`)
                    .join("\n");
    
                const content = `Nodit Blockchain Context Webhook api has endpoints with patterns like https://web3.nodit.io/v1/{chain}/{network}/webhooks. For example, Ethereum mainnet uses an endpoint like https://web3.nodit.io/v1/ethereum/mainnet/webhooks.
    The API list is as follows. You can use the get_nodit_api_spec tool to get more detailed API specifications. However, the API cannot be invoked using the call_nodit_api tool.
    - baseUrl: ${noditWebhookApiSpec.servers[0].url}
    - Available Nodit API Operations:
    ${formattedList}
    `
                return {content: [{type: "text", text: content}]};
            } catch(error) {
                return createErrorResponse(`Failed to list webhook APIs: ${(error as Error).message}`, toolName)
            }
        });
  • Registers the 'list_nodit_webhook_apis' tool on the MCP server with description, empty input schema, and inline handler function.
    export function registerWebhookApiTools(server: McpServer) {
        const toolName = "list_nodit_webhook_apis";
        const noditWebhookApiSpec: NoditOpenApiSpecType = loadNoditWebhookApiSpec()
    
        const apis = Object.values(noditWebhookApiSpec.paths).flatMap((pathItem) => {
            return [pathItem.get, pathItem.post, pathItem.put, pathItem.patch, pathItem.delete].filter((item) => item !== undefined).map((item) => {
                if (item && item.operationId) {
                    const operationId = item.operationId;
                    const description = item.description;
                    const chains = item.parameters?.find((param) => param.name === "chain")?.schema?.enum ?? ["aptos"];
    
                    return {
                        operationId,
                        description,
                        chains
                    }
                }
            })
        }).filter((api) => api !== undefined);
        
        server.tool(toolName, "Lists available Nodit Webhook API operations.", {}, () => {
            try {
                const formattedList = apis
                    .map(api => `  - operationId: ${api.operationId}, supported chains: [${api.chains.join(',')}], description: ${api.description}`)
                    .join("\n");
    
                const content = `Nodit Blockchain Context Webhook api has endpoints with patterns like https://web3.nodit.io/v1/{chain}/{network}/webhooks. For example, Ethereum mainnet uses an endpoint like https://web3.nodit.io/v1/ethereum/mainnet/webhooks.
    The API list is as follows. You can use the get_nodit_api_spec tool to get more detailed API specifications. However, the API cannot be invoked using the call_nodit_api tool.
    - baseUrl: ${noditWebhookApiSpec.servers[0].url}
    - Available Nodit API Operations:
    ${formattedList}
    `
                return {content: [{type: "text", text: content}]};
            } catch(error) {
                return createErrorResponse(`Failed to list webhook APIs: ${(error as Error).message}`, toolName)
            }
        });
    }
  • Central registration function that calls registerWebhookApiTools among others.
    export function registerAllTools(server: McpServer) {
      registerApiCategoriesTools(server);
      registerNodeApiTools(server);
      registerDataApiTools(server);
      registerWebhookApiTools(server);
      registerAptosIndexerTools(server);
      registerGetNoditApiSpecTool(server);
      registerCallNoditApiTool(server);
    }
  • Helper to load the Nodit webhook OpenAPI YAML spec file into typed object used by the tool.
    export function loadNoditWebhookApiSpec(): NoditOpenApiSpecType {
      const specPath = path.resolve(__dirname, '../spec/reference/webhook.yaml');
      return loadOpenapiSpecFile(specPath) as NoditOpenApiSpecType;
    }
  • TypeScript interface defining the structure of the Nodit OpenAPI spec used for parsing paths and operations.
    export interface NoditOpenApiSpecType {
      openapi: string;
      info: { title: string; version: string };
      servers: [{ url: string; variables?: Record<string, { default: string }> }];
      paths: Record<string, OpenApiPathItem>;
      components: any;
      security: any[];
    }

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