Skip to main content
Glama

get_contract_role

Identify the role and purpose of a Voi blockchain contract, such as liquidity pool, bridge, or registry, by providing its application ID.

Instructions

Get the role and purpose of a specific contract on Voi (e.g. liquidity-pool, bridge, registry)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesApplication ID on Voi

Implementation Reference

  • Handler function for get_contract_role tool that looks up a contract by appId, retrieves its role, type, name, protocol, and description from the registry, and returns formatted results
    server.tool(
      "get_contract_role",
      "Get the role and purpose of a specific contract on Voi (e.g. liquidity-pool, bridge, registry)",
      {
        appId: z
          .number()
          .int()
          .describe("Application ID on Voi"),
      },
      async ({ appId }) => {
        const app = findApplication(appId);
        if (!app) {
          return toolResult({
            appId,
            known: false,
            role: null,
            message: `Contract ${appId} is not in the Voi ecosystem registry`,
          });
        }
        const protocol = app.protocol ? findProtocol(app.protocol) : null;
        return toolResult({
          appId,
          known: true,
          role: app.role,
          type: app.type,
          name: app.name,
          protocol: app.protocol,
          protocolName: protocol?.name || null,
          description: app.description,
        });
      },
  • Helper function that looks up an application in the registry by appId, returning null if not found
    export function findApplication(appId) {
      const apps = getApplications();
      return apps[String(appId)] || null;
    }
  • Helper function that finds a protocol by ID to provide protocol name for the application
    export function findProtocol(id) {
      return getProtocols().find((p) => p.id === id) || null;
    }
  • Helper function that formats tool response data as JSON text content for MCP protocol
    export function toolResult(data) {
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It clearly signals a read-only operation via 'Get' and provides a hint of the output ('role and purpose'), but it does not describe error handling, return structure, or any access limitations. This is adequate for a simple getter but not richly transparent.

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?

A single, front-loaded sentence communicates the tool's purpose and includes examples. No wasted words; every part contributes to understanding.

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

Completeness4/5

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

The tool is simple (one required parameter, no output schema), and the description adequately conveys its purpose and scope. It could mention relation to sibling tools or potential error cases, but for a straightforward getter, the information is sufficient to invoke it correctly.

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 schema covers 100% of the parameter (appId) with a description ('Application ID on Voi'). The description does not add further parameter-level detail, but with full schema coverage, the baseline of 3 is appropriate.

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

Purpose5/5

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

The description uses a specific verb 'Get' with a clear resource ('role and purpose of a specific contract') and provides concrete examples (liquidity-pool, bridge, registry). This clearly distinguishes it from sibling tools like identify_application, which focuses on identification rather than role labeling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (when you need to know a contract's role), but it does not explicitly mention alternatives or exclude cases. It could reference identify_application for generic identification, but the intended use case is understandable from the examples.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.