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;
    }

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/MaidToShelly/UluVoiMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server