Skip to main content
Glama

get_protocol_summary

Generate human-readable summaries of Voi protocols including purpose, contracts, and assets to understand blockchain ecosystem services.

Instructions

Get a human-readable summary of a Voi protocol including its purpose, contracts, and assets

Input Schema

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

Implementation Reference

  • The handler function for get_protocol_summary tool. It retrieves protocol details, contracts, and assets, then formats them into a human-readable markdown summary with sections for type, website, description, contracts (grouped by type), assets, and tags.
      async ({ protocolId }) => {
        const protocol = findProtocol(protocolId);
        if (!protocol) {
          return toolError(`Unknown protocol: ${protocolId}`);
        }
        const contracts = protocolContracts(protocolId);
        const assets = protocolAssets(protocolId);
    
        const lines = [
          `# ${protocol.name}`,
          ``,
          `**Type:** ${protocol.type}`,
          `**Website:** ${protocol.website || "N/A"}`,
          ``,
          protocol.description,
          ``,
          `## Contracts (${contracts.length})`,
        ];
    
        const byType = {};
        for (const c of contracts) {
          const t = c.type || "other";
          if (!byType[t]) byType[t] = [];
          byType[t].push(c);
        }
        for (const [type, items] of Object.entries(byType)) {
          lines.push(`- **${type}**: ${items.length} contract(s)`);
          for (const item of items.slice(0, 5)) {
            lines.push(`  - ${item.appId}: ${item.name}`);
          }
          if (items.length > 5) {
            lines.push(`  - ... and ${items.length - 5} more`);
          }
        }
    
        if (assets.length > 0) {
          lines.push(``, `## Assets (${assets.length})`);
          for (const a of assets) {
            lines.push(`- ${a.symbol} (${a.assetId}): ${a.name} — ${a.category}`);
          }
        }
    
        lines.push(``, `**Tags:** ${(protocol.tags || []).join(", ")}`);
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      },
    );
  • Zod schema definition for the protocolId input parameter, requiring a string that describes the protocol identifier (e.g. humble-swap, envoi, aramid-bridge).
    {
      protocolId: z
        .string()
        .describe("Protocol identifier (e.g. humble-swap, envoi, aramid-bridge)"),
    },
  • Registration of the get_protocol_summary tool with the MCP server using server.tool(), including the tool name, description, input schema, and handler function.
    server.tool(
      "get_protocol_summary",
      "Get a human-readable summary of a Voi protocol including its purpose, contracts, and assets",
      {
        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);
    
        const lines = [
          `# ${protocol.name}`,
          ``,
          `**Type:** ${protocol.type}`,
          `**Website:** ${protocol.website || "N/A"}`,
          ``,
          protocol.description,
          ``,
          `## Contracts (${contracts.length})`,
        ];
    
        const byType = {};
        for (const c of contracts) {
          const t = c.type || "other";
          if (!byType[t]) byType[t] = [];
          byType[t].push(c);
        }
        for (const [type, items] of Object.entries(byType)) {
          lines.push(`- **${type}**: ${items.length} contract(s)`);
          for (const item of items.slice(0, 5)) {
            lines.push(`  - ${item.appId}: ${item.name}`);
          }
          if (items.length > 5) {
            lines.push(`  - ... and ${items.length - 5} more`);
          }
        }
    
        if (assets.length > 0) {
          lines.push(``, `## Assets (${assets.length})`);
          for (const a of assets) {
            lines.push(`- ${a.symbol} (${a.assetId}): ${a.name} — ${a.category}`);
          }
        }
    
        lines.push(``, `**Tags:** ${(protocol.tags || []).join(", ")}`);
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      },
    );
  • findProtocol helper function that searches the protocols list to find a protocol by its ID, returning null if not found.
    export function findProtocol(id) {
      return getProtocols().find((p) => p.id === id) || null;
    }
  • protocolContracts and protocolAssets helper functions that filter applications and assets by protocol ID, returning arrays with appId/assetId and their associated info.
    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;
    }
    
    export function protocolAssets(protocolId) {
      const a = getAssets();
      const results = [];
      for (const [assetId, info] of Object.entries(a)) {
        if (info.protocol === protocolId) {
          results.push({ assetId: Number(assetId), ...info });
        }
      }
      return results;
    }

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?

With no annotations, the description carries the burden of behavioral disclosure. It does reveal that the output is human-readable and includes purpose, contracts, and assets, adding value beyond the tool name. However, it does not specify the return format (plain text, JSON, markdown), any access permissions, or whether contracts/assets are comprehensive or filtered.

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 filler or redundant information. Every word contributes to conveying the tool's purpose.

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?

For a simple one-parameter read tool with no output schema, the description covers the essential aspects: what the tool returns and for what. It is adequate for an agent to understand the tool's role, though it could add a bit more detail on the exact nature of the summary.

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 coverage is 100%: the sole parameter protocolId has a clear description with examples. The tool description does not add additional meaning about the parameter beyond what the schema already provides, so the baseline of 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 clearly states the tool's purpose: getting a human-readable summary of a Voi protocol with specific content (purpose, contracts, assets). It uses a specific verb and resource, and the 'summary' aspect distinguishes it from sibling tools like get_protocol or get_protocol_contracts.

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 the tool (when a summary is needed) but provides no explicit guidance on when to prefer it over alternatives like get_protocol or get_protocol_contracts. There are no exclusions or alternative tool names mentioned.

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