Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_create_swap

Create asset swaps on the RGB Lightning Network to exchange digital assets using specified swap parameters for peer-to-peer transactions.

Instructions

Create a new asset swap

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
swapParamsYesSwap parameters object

Implementation Reference

  • src/server.ts:252-267 (registration)
    Registration of the 'rgb_create_swap' tool, including input schema (loose passthrough object) and inline handler that calls rgbClient.createSwap(swapParams) and returns JSON result.
    server.tool(
      'rgb_create_swap',
      'Create a new asset swap',
      {
        swapParams: z.object({}).passthrough().describe('Swap parameters object'),
      },
      async ({ swapParams }) => {
        try {
          const result = await rgbClient.createSwap(swapParams);
          return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
        }
      }
    );
  • Helper wrapper method in RGBApiClientWrapper that delegates the swap creation to the underlying RgbApiClient SDK's swaps.createSwap method.
    async createSwap(swapParams: any) {
      return await this.client.swaps.createSwap(swapParams);
    }
  • Type definition for swap parameters (loose object type). Note: the zod schema in registration is also loose.
    export interface SwapParams {
      [key: string]: any;
    }
Behavior1/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 only states the action 'create' without detailing permissions, side effects, error conditions, or response format. For a tool that likely involves financial transactions, this lack of transparency is a significant gap.

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, efficient sentence with no wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity of asset swaps, lack of annotations, and no output schema, the description is incomplete. It fails to explain what an asset swap is, its implications, or what the tool returns, leaving critical gaps for an agent to understand and use the tool effectively.

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 description coverage is 100%, with the parameter 'swapParams' documented as a 'Swap parameters object'. The description does not add any meaning beyond this, such as explaining what swap parameters include or providing examples. Baseline 3 is appropriate as the schema handles the heavy lifting.

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

Purpose2/5

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

The description 'Create a new asset swap' restates the tool name 'rgb_create_swap' with minimal elaboration, making it tautological. It specifies the verb 'create' and resource 'asset swap' but lacks detail on what an asset swap entails or how it differs from sibling tools like rgb_send_assets or rgb_list_swaps, leaving the purpose vague.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives such as rgb_send_assets or rgb_list_swaps. The description does not mention prerequisites, context, or exclusions, offering no help for an agent to decide between tools in this financial/asset management domain.

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