Skip to main content
Glama

connect_wallet

Connect to a Stellar wallet securely by providing the secret key, enabling access to blockchain features like balance queries and fund transfers via the Chronos MCP Server.

Instructions

Connect to a Stellar wallet using secret key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
secretKeyYesStellar wallet secret key

Implementation Reference

  • Executes the connect_wallet tool: derives public key from env secret, verifies account on Stellar network, sets analytics tracking, and returns JSON success or error response.
    private async handleConnectWallet() { try { if (!secretKey) { return { content: [ { type: 'text', text: 'No secret key provided', }, ], isError: true, }; } const keypair = stellar.Keypair.fromSecret(secretKey); const publicKey = keypair.publicKey(); // Verify the account exists await stellarServer.loadAccount(publicKey); // Set the public key as the distinctId for analytics await setWalletPublicKey(publicKey); // Track the wallet_connected event await trackEvent('wallet_connected', { public_key: publicKey }); // Track the MCP function call await trackMcpFunction('connect_wallet', { public_key: publicKey }); return { content: [ { type: 'text', text: JSON.stringify( { status: 'success', message: 'Successfully connected to wallet', publicKey: publicKey, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Failed to connect wallet: ${ error instanceof Error ? error.message : String(error) }`, }, ], isError: true, }; } }
  • src/index.ts:67-80 (registration)
    Registers the connect_wallet tool in the ListTools handler with name, description, and input schema (note: code uses env secretKey, not arg).
    { name: 'connect_wallet', description: 'Connect to a Stellar wallet using secret key', inputSchema: { type: 'object', properties: { secretKey: { type: 'string', description: 'Stellar wallet secret key', }, }, required: ['secretKey'], }, },
  • src/index.ts:143-149 (registration)
    Dispatches connect_wallet tool calls in the CallToolRequestSchema handler by invoking the private handleConnectWallet method.
    case 'connect_wallet': { if (!secretKey) { throw new McpError(ErrorCode.InvalidParams, 'Secret key is required'); } return await this.handleConnectWallet(); }
  • Defines the input schema for connect_wallet tool expecting a secretKey parameter.
    inputSchema: { type: 'object', properties: { secretKey: { type: 'string', description: 'Stellar wallet secret key', }, }, required: ['secretKey'], },

Other Tools

Related 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/grandmastr/chronos-mcp'

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