Skip to main content
Glama

get_protocol_contracts

Retrieve all application contracts for a specific Voi protocol to identify contract roles and explore ecosystem services.

Instructions

List all known application contracts for a Voi protocol

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protocolIdYesProtocol identifier (e.g. humble-swap, envoi, aramid-bridge)

Implementation Reference

  • The async handler function that executes the 'get_protocol_contracts' tool logic. It validates the protocol exists using findProtocol(), retrieves contracts via protocolContracts(), assets via protocolAssets(), and returns the combined result.
    async ({ protocolId }) => {
      const protocol = findProtocol(protocolId);
      if (!protocol) {
        return toolError(`Unknown protocol: ${protocolId}`);
      }
      const contracts = protocolContracts(protocolId);
      const assets = protocolAssets(protocolId);
      return toolResult({
        protocol: protocolId,
        name: protocol.name,
        contracts,
        assets,
      });
    },
  • Input schema definition for 'get_protocol_contracts' tool using Zod. Defines a required 'protocolId' string parameter with description.
    {
      protocolId: z
        .string()
        .describe("Protocol identifier (e.g. humble-swap, envoi, aramid-bridge)"),
    },
  • Registration of the 'get_protocol_contracts' tool with the MCP server using server.tool(). Includes tool name, description, schema, and handler.
    server.tool(
      "get_protocol_contracts",
      "List all known application contracts for a Voi protocol",
      {
        protocolId: z
          .string()
          .describe("Protocol identifier (e.g. humble-swap, envoi, aramid-bridge)"),
      },
      async ({ protocolId }) => {
        const protocol = findProtocol(protocolId);
        if (!protocol) {
          return toolError(`Unknown protocol: ${protocolId}`);
        }
        const contracts = protocolContracts(protocolId);
        const assets = protocolAssets(protocolId);
        return toolResult({
          protocol: protocolId,
          name: protocol.name,
          contracts,
          assets,
        });
      },
    );
  • Helper function that retrieves all application contracts for a given protocol ID by filtering the applications registry.
    export function protocolContracts(protocolId) {
      const apps = getApplications();
      const results = [];
      for (const [appId, info] of Object.entries(apps)) {
        if (info.protocol === protocolId) {
          results.push({ appId: Number(appId), ...info });
        }
      }
      return results;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/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. It clearly states a read-only listing operation, but offers no additional behavioral context such as authentication, pagination, or what 'known' means. It is functional but minimal.

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, front-loaded sentence with no redundant words. It efficiently conveys the core function.

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 simple one-parameter interface and lack of output schema, the description is adequate but does not explain return structure or the nature of 'application contracts'. Slightly more context could improve completeness, but it is not severely deficient.

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?

Schema description coverage is 100% and the protocolId parameter already has a clear description with examples. The tool description adds no extra meaning beyond the schema, so baseline 3 applies.

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 ('List') and resource ('known application contracts') scoped to a Voi protocol. This clearly distinguishes it from siblings like get_protocols (list protocols) and get_protocol_summary (summary of a single protocol).

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?

Usage is implied by the description: when you need to list contracts for a specific protocol. However, there is no explicit guidance on when to choose this over related tools, nor any exclusions or alternative mentions.

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