Skip to main content
Glama

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, ];

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