Skip to main content
Glama
StevenGeller

LDK MCP Server

by StevenGeller

ios_background_test

Test Lightning Network background processing and channel monitoring for iOS wallet development. Verify sync, monitor, and payment tasks in background mode.

Instructions

Test Lightning background processing and channel monitoring

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskTypeNoType of background task to testsync

Implementation Reference

  • The execute function implementing the core logic of the 'ios_background_test' tool. It tests iOS background processing via iosService and returns structured results including best practices and plist configuration.
      execute: async (args: any): Promise<ToolResult> => {
        try {
          const result = await iosService.testBackgroundProcessing();
          
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({
                success: result.success,
                message: result.message,
                swiftExample: result.swiftCode,
                taskType: args.taskType,
                bestPractices: [
                  'Register background tasks in Info.plist',
                  'Use BGProcessingTask for longer operations',
                  'Implement proper task expiration handling',
                  'Schedule tasks based on user behavior',
                  'Monitor battery and network conditions',
                  'Persist state before task completion'
                ],
                plistConfiguration: `
    <!-- Add to Info.plist -->
    <key>BGTaskSchedulerPermittedIdentifiers</key>
    <array>
        <string>com.yourapp.lightning.sync</string>
        <string>com.yourapp.lightning.monitor</string>
        <string>com.yourapp.lightning.payment</string>
    </array>
    
    <key>UIBackgroundModes</key>
    <array>
        <string>fetch</string>
        <string>processing</string>
    </array>`.trim()
              }, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: error instanceof Error ? error.message : 'Unknown error'
              }, null, 2)
            }],
            isError: true
          };
        }
      }
  • Input schema for the tool defining the optional taskType parameter.
    inputSchema: {
      type: 'object',
      properties: {
        taskType: {
          type: 'string',
          enum: ['sync', 'monitor', 'payment'],
          description: 'Type of background task to test',
          default: 'sync'
        }
      }
    },
  • src/index.ts:19-19 (registration)
    Import statement registering the backgroundTestTool for use in the MCP server.
    import { backgroundTestTool } from './tools/iosBackgroundTest.js';
  • src/index.ts:38-62 (registration)
    The tools array that includes backgroundTestTool, used by the MCP server handlers for listing and executing tools.
    const tools = [
      generateInvoiceTool,
      payInvoiceTool,
      getChannelStatusTool,
      getNodeInfoTool,
      backupStateTool,
      keychainTestTool,
      backgroundTestTool,
      pushNotificationTool,
      biometricAuthTool,
      createChannelTool,
      closeChannelTool,
      getBalanceTool,
      decodeInvoiceTool,
      listPaymentsTool,
      estimateFeeTool,
      generateMnemonicTool,
      deriveAddressTool,
      getSwiftCodeTool,
      getArchitectureTool,
      testScenarioTool,
      networkGraphTool,
      eventHandlingTool,
      chainSyncTool,
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'test' but doesn't clarify if this is a read-only diagnostic, a simulation that might affect state, or has side effects like network calls. No details on permissions, rate limits, or output behavior are included, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple tool, though it could be slightly more informative without losing conciseness.

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 testing Lightning network operations, no annotations, and no output schema, the description is incomplete. It lacks details on what the test does, expected outcomes, or error handling, making it insufficient for an agent to understand the tool's full context and behavior.

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?

The input schema has 100% description coverage, with 'taskType' well-documented via enum and description. The description adds no additional parameter semantics beyond what the schema provides, such as explaining the implications of each task type. Baseline 3 is appropriate since the schema handles the heavy lifting.

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 'Test Lightning background processing and channel monitoring' specifies a verb ('Test') and resource ('Lightning background processing and channel monitoring'), but it's vague about what 'test' entails—whether it's validation, simulation, or debugging. It distinguishes from siblings by focusing on Lightning network tasks, but lacks specificity on the exact operation.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description implies usage for testing Lightning-related background tasks, but it doesn't specify contexts, prerequisites, or exclusions, such as when to choose this over other iOS or LDK tools for similar functions.

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/StevenGeller/ldk-mcp'

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