Skip to main content
Glama

get_nodit_api_spec

Retrieve resolved API specification details for blockchain operations to understand available data structures and parameters.

Instructions

Gets the fully resolved spec details for a Nodit Blockchain Context API operationId. Returns details as a JSON string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationIdYesThe operationId to get the resolved specification for.

Implementation Reference

  • Handler logic that identifies the API type based on operationId, retrieves spec details using helper functions, formats the response, and returns JSON string or error.
    async ({ operationId }) => {
      const toolName = "get_nodit_api_spec";
      log(`Tool (${toolName}): Request for operationId: ${operationId}`);
    
      let apiInfo;
        if (isNodeApi(operationId)) {
            apiInfo = findNoditNodeApiDetails(operationId, noditNodeApiSpecMap);
        } else if (isWebhookApi(operationId)) {
            const postfix = "\nThis API cannot be invoked using the call_nodit_api tool."
            apiInfo = findNoditWebhookApiDetails(operationId, noditWebhookApiSpec);
            if (apiInfo && !apiInfo.details.description?.endsWith(postfix)) {
                apiInfo.details.description = apiInfo.details.description + postfix;
            }
        } else {
            apiInfo = findNoditDataApiDetails(operationId, noditDataApiSpec);
        }
      if (!apiInfo) {
        return createErrorResponse(`Spec for operationId '${operationId}' not found.`, toolName);
      }
    
      const finalSpecDetails = {
        operationId: operationId,
        path: apiInfo.path,
        method: apiInfo.method,
        details: apiInfo.details,
      };
    
      return { content: [{ type: "text", text: JSON.stringify(finalSpecDetails, null, 2) }] };
    }
  • Zod input schema defining the operationId parameter.
    { operationId: z.string().describe("The operationId to get the resolved specification for.") },
  • Function that registers the tool by loading API specs and calling server.tool with name, description, schema, and handler.
    export function registerGetNoditApiSpecTool(server: McpServer) {
      const noditNodeApiSpecMap: Map<string, NoditOpenApiSpecType> = loadNoditNodeApiSpecMap();
      const noditDataApiSpec: NoditOpenApiSpecType = loadNoditDataApiSpec();
      const noditWebhookApiSpec: NoditOpenApiSpecType = loadNoditWebhookApiSpec();
    
      server.tool(
        "get_nodit_api_spec",
        "Gets the fully resolved spec details for a Nodit Blockchain Context API operationId. Returns details as a JSON string.",
        { operationId: z.string().describe("The operationId to get the resolved specification for.") },
        async ({ operationId }) => {
          const toolName = "get_nodit_api_spec";
          log(`Tool (${toolName}): Request for operationId: ${operationId}`);
    
          let apiInfo;
            if (isNodeApi(operationId)) {
                apiInfo = findNoditNodeApiDetails(operationId, noditNodeApiSpecMap);
            } else if (isWebhookApi(operationId)) {
                const postfix = "\nThis API cannot be invoked using the call_nodit_api tool."
                apiInfo = findNoditWebhookApiDetails(operationId, noditWebhookApiSpec);
                if (apiInfo && !apiInfo.details.description?.endsWith(postfix)) {
                    apiInfo.details.description = apiInfo.details.description + postfix;
                }
            } else {
                apiInfo = findNoditDataApiDetails(operationId, noditDataApiSpec);
            }
          if (!apiInfo) {
            return createErrorResponse(`Spec for operationId '${operationId}' not found.`, toolName);
          }
    
          const finalSpecDetails = {
            operationId: operationId,
            path: apiInfo.path,
            method: apiInfo.method,
            details: apiInfo.details,
          };
    
          return { content: [{ type: "text", text: JSON.stringify(finalSpecDetails, null, 2) }] };
        }
      );
    }
  • Top-level call to register the get_nodit_api_spec tool during all tools registration.
    registerGetNoditApiSpecTool(server);
  • Helper function to load Nodit node API specs into a map, used in the tool registration and handler.
    export function loadNoditNodeApiSpecMap(): Map<string, NoditOpenApiSpecType> {
      const noditApiSpecMap = new Map<string, NoditOpenApiSpecType>();
      const specDir = path.resolve(__dirname, '../spec/reference');
    
      try {
        const files = fs.readdirSync(specDir);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that it 'Returns details as a JSON string,' which adds some context about the output format, but it lacks critical details such as whether this is a read-only operation, potential error conditions, rate limits, or authentication requirements. For a tool with no annotation coverage, this is a significant gap.

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 concise and front-loaded, consisting of two clear sentences that directly state the tool's purpose and output format. There is no wasted language, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a single-parameter read operation), the description is minimally adequate. It explains what the tool does and the output format, but with no annotations and no output schema, it lacks details on error handling, response structure, or integration context. This leaves gaps for an agent to fully understand the tool's behavior.

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

Parameters3/5

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

The input schema has 100% description coverage, with the parameter 'operationId' clearly documented. The description adds no additional meaning beyond what the schema provides, such as examples or constraints on the operationId format. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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 tool's purpose with a specific verb ('Gets') and resource ('fully resolved spec details for a Nodit Blockchain Context API operationId'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_nodit_aptos_indexer_api_spec' or 'list_nodit_api_categories', which might provide similar or overlapping functionality.

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. It doesn't mention any prerequisites, context for usage, or exclusions, leaving the agent to infer usage based on the name and description alone, which is insufficient for optimal tool selection.

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