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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "rgb_list_swaps"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:242-250 (handler)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 }; } } ); - src/rgb-client.ts:102-103 (helper)Helper method in RGBApiClientWrapper that proxies the listSwaps call to the underlying SDK client.
async listSwaps() { return await this.client.swaps.listSwaps();