Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_list_swaps

Lists available RGB asset swaps to help users identify trading opportunities between different digital assets on the Lightning Network.

Instructions

List available swaps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function for 'rgb_list_swaps'. It calls rgbClient.listSwaps() to fetch swaps and returns a JSON-formatted text response or an error message.
        try {
          const swaps = await rgbClient.listSwaps();
          return { content: [{ type: 'text', text: JSON.stringify(swaps, null, 2) }] };
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
        }
      }
    );
  • src/server.ts:238-250 (registration)
    Registration of the 'rgb_list_swaps' MCP tool using server.tool, including empty input schema and inline handler.
      'rgb_list_swaps',
      'List available swaps',
      {},
      async ({}) => {
        try {
          const swaps = await rgbClient.listSwaps();
          return { content: [{ type: 'text', text: JSON.stringify(swaps, null, 2) }] };
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
        }
      }
    );
  • Helper method in RGBApiClientWrapper that proxies the listSwaps call to the underlying SDK client.
    async listSwaps() {
      return await this.client.swaps.listSwaps();
Behavior2/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 of behavioral disclosure. It states 'List available swaps', implying a read-only operation, but does not specify if it requires authentication, has rate limits, returns paginated results, or what 'available' means (e.g., pending vs. completed). This leaves significant gaps in understanding the tool's behavior.

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 extremely concise with 'List available swaps', a single phrase that is front-loaded and wastes no words. It efficiently conveys the core action without unnecessary elaboration, making it easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimal but insufficient. It does not explain what 'swaps' are, the return format, or behavioral aspects like safety or constraints. For a list operation among many siblings, more context is needed to ensure proper usage, making it incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter details, but since there are no parameters, this is acceptable. A baseline of 4 is appropriate as the schema fully covers the absence of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List available swaps' clearly states the verb ('List') and resource ('swaps'), making the purpose understandable. However, it lacks specificity about what 'swaps' are in this context (e.g., asset swaps, lightning swaps) and does not differentiate from sibling tools like 'rgb_list_assets' or 'rgb_list_transactions', leaving ambiguity about scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, context (e.g., after creating a swap), or exclusions, and with siblings like 'rgb_list_assets' and 'rgb_list_transactions', the agent has no explicit direction on selecting this tool for 'swaps' specifically.

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

Install Server

Other Tools

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/lnfi-network/rgb-mcp-server'

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