Skip to main content
Glama

get_protocol

Retrieve detailed information about Voi ecosystem protocols by ID to understand contract roles, services, and functionality for protocols like HumbleSwap and Nautilus.

Instructions

Get detailed information about a specific Voi ecosystem protocol by ID

Input Schema

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

Implementation Reference

  • The handler function for 'get_protocol' tool. Takes a protocolId parameter, looks up the protocol using findProtocol(), and returns either the protocol details or an error if not found.
    async ({ protocolId }) => {
      const protocol = findProtocol(protocolId);
      if (!protocol) {
        return toolError(`Unknown protocol: ${protocolId}`);
      }
      return toolResult(protocol);
    },
  • Zod schema definition for 'get_protocol' tool input. Defines 'protocolId' as a required string parameter with a description for the protocol identifier.
    {
      protocolId: z
        .string()
        .describe("Protocol identifier (e.g. humble-swap, envoi, aramid-bridge)"),
  • Registration of the 'get_protocol' tool using server.tool(). Includes the tool name, description, input schema, and handler function.
    server.tool(
      "get_protocol",
      "Get detailed information about a specific Voi ecosystem protocol by ID",
      {
        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}`);
        }
        return toolResult(protocol);
      },
    );
  • The findProtocol() helper function that searches the protocols array to find a protocol by ID. Returns the protocol object or null if not found.
    export function findProtocol(id) {
      return getProtocols().find((p) => p.id === id) || null;
    }
  • Helper functions toolResult() and toolError() used to format the tool's response output. toolResult wraps data as JSON content, toolError creates error responses.
    export function toolResult(data) {
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
    
    export function toolError(message) {
      return {
        content: [{ type: "text", text: JSON.stringify({ error: message }) }],
        isError: true,
      };
    }

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