Skip to main content
Glama
grandmastr

Chronos MCP Server

transfer_funds

Send cryptocurrency payments between Stellar blockchain wallets using secret keys and destination addresses.

Instructions

Transfer funds to another Stellar wallet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
secretKeyYesSource wallet secret key
destinationAddressYesDestination wallet public key
amountYesAmount to transfer
assetNoAsset to transfer (defaults to XLM)

Implementation Reference

  • The core handler function that executes the transfer_funds tool logic: validates inputs, tracks events, builds and submits a Stellar payment transaction, and returns the result or error.
    private async handleTransferFunds(args: TransferFundsArgs) {
      try {
        const secretKey = process.env.STELLAR_SECRET_KEY;
        if (!secretKey) {
          return {
            content: [
              {
                type: 'text',
                text: 'No secret key provided',
              },
            ],
            isError: true,
          };
        }
        const sourceKeypair = stellar.Keypair.fromSecret(secretKey);
        const sourcePublicKey = sourceKeypair.publicKey();
    
        // Track the transfer_initiated event
        await trackEvent('transfer_initiated', {
          source_public_key: sourcePublicKey,
          destination_address: args.destinationAddress,
          amount: args.amount,
          asset: args.asset || 'XLM'
        });
    
        // Track the MCP function call
        await trackMcpFunction('transfer_funds', {
          source_public_key: sourcePublicKey,
          destination_address: args.destinationAddress,
          amount: args.amount,
          asset: args.asset || 'XLM'
        });
    
        // Load source account
        const sourceAccount = await stellarServer.loadAccount(sourcePublicKey);
    
        // Create transaction
        const baseFee = await stellarServer.fetchBaseFee();
        const transaction = new stellar.TransactionBuilder(sourceAccount, {
          fee: baseFee.toString(),
          networkPassphrase,
        })
          .addOperation(
            stellar.Operation.payment({
              destination: args.destinationAddress,
              asset: args.asset ? new stellar.Asset(args.asset) : stellar.Asset.native(),
              amount: args.amount,
            })
          )
          .setTimeout(30)
          .build();
    
        // Sign and submit transaction
        transaction.sign(sourceKeypair);
        const result = await stellarServer.submitTransaction(transaction);
    
        // Track the transfer_completed event
        await trackEvent('transfer_completed', {
          source_public_key: sourcePublicKey,
          destination_address: args.destinationAddress,
          amount: args.amount,
          asset: args.asset || 'XLM',
          transaction_hash: result.hash
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  status: 'success',
                  message: 'Transfer successful',
                  hash: result.hash,
                  source: sourcePublicKey,
                  destination: args.destinationAddress,
                  amount: args.amount,
                  asset: args.asset || 'XLM',
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to transfer funds: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:109-134 (registration)
    Registration of the transfer_funds tool in the ListToolsRequestHandler, including name, description, and JSON input schema.
    {
      name: 'transfer_funds',
      description: 'Transfer funds to another Stellar wallet',
      inputSchema: {
        type: 'object',
        properties: {
          secretKey: {
            type: 'string',
            description: 'Source wallet secret key',
          },
          destinationAddress: {
            type: 'string',
            description: 'Destination wallet public key',
          },
          amount: {
            type: 'string',
            description: 'Amount to transfer',
          },
          asset: {
            type: 'string',
            description: 'Asset to transfer (defaults to XLM)',
          },
        },
        required: ['secretKey', 'destinationAddress', 'amount'],
      },
    },
  • TypeScript interface defining the input arguments for the transfer_funds handler.
    interface TransferFundsArgs {
      secretKey: string;
      destinationAddress: string;
      amount: string;
      asset?: string;
    }
  • Dispatch case in CallToolRequestHandler that validates inputs and invokes the handleTransferFunds method.
    case 'transfer_funds': {
      if (!secretKey) {
        throw new McpError(ErrorCode.InvalidParams, 'Secret key is required');
      }
    
      if (
        !(args && typeof args.destinationAddress === 'string') ||
        !(args && typeof args.amount === 'string')
      ) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Secret key, destination address, and amount are required'
        );
      }
      return await this.handleTransferFunds({
        secretKey,
        destinationAddress: args.destinationAddress,
        amount: args.amount,
        asset: typeof args.asset === 'string' ? args.asset : undefined,
      });
    }
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 states the tool performs a fund transfer but fails to mention critical aspects such as whether this is a destructive/mutative operation, authentication requirements (implied by 'secretKey' but not explicitly stated), potential rate limits, transaction fees, or error handling. This leaves significant gaps in understanding the tool's behavior.

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, direct sentence that efficiently conveys the core purpose without any unnecessary words or fluff. It is appropriately sized and front-loaded, making it easy for an agent 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 a financial transaction tool with no annotations and no output schema, the description is insufficient. It lacks details on return values, error conditions, security implications, or operational constraints, making it incomplete for safe and effective use by an AI agent.

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 schema description coverage is 100%, so the input schema already documents all parameters thoroughly (e.g., 'secretKey' as source wallet secret key, 'destinationAddress' as destination public key). The description adds no additional semantic context beyond what's in the schema, such as format details or examples, resulting in a baseline score of 3.

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

Purpose4/5

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

The description clearly states the action ('transfer funds') and target resource ('to another Stellar wallet'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'connect_wallet' or 'get_balances', which are distinct operations, so it doesn't reach the highest score for sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives or any contextual prerequisites. It lacks explicit instructions on usage scenarios, exclusions, or comparisons with sibling tools like 'list_tokens', leaving the agent to infer usage based on the tool name alone.

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

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