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
| Name | Required | Description | Default |
|---|---|---|---|
| protocolId | Yes | Protocol identifier (e.g. humble-swap, envoi, aramid-bridge) |
Implementation Reference
- tools/protocols.js:46-52 (handler)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); }, - tools/protocols.js:41-44 (schema)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)"), - tools/protocols.js:38-53 (registration)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); }, ); - lib/registry.js:38-40 (helper)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; } - lib/errors.js:1-10 (helper)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, }; }