Skip to main content
Plugins are the building blocks of the Synto Mobile AI agent. Each plugin adds a specific set of capabilities, from token operations to DeFi integrations. This modular design makes the agent extensible and maintainable.

Plugin architecture

Every plugin follows a standard interface that the agent understands:
interface Plugin {
  name: string;                          // Unique identifier
  methods: Record<string, any>;          // Callable functions
  actions: Action[];                     // Available actions
  initialize(agent: SolanaAgentKit): void; // Setup hook
}
Plugins are loaded when the agent initializes and cannot be added or removed at runtime.

How plugins work

When you add a plugin to the agent:
  1. Registration - Plugin is registered in the agent’s plugin map
  2. Initialization - initialize() is called with agent instance
  3. Method binding - All plugin methods are bound to the agent’s methods object
  4. Action registration - Actions are added to the agent’s action list
// Adding a plugin
const agent = new SolanaAgentKit(wallet, rpc, config);
const agentWithPlugin = agent.use(TokenPlugin);

// Now you can call plugin methods
agentWithPlugin.methods.transfer(recipient, amount);
Source: utils/syntoUtils/agent/core/index.ts:61

Method conflicts

The agent prevents method name conflicts:
If two plugins try to register a method with the same name, the agent throws an error. Method names must be unique across all loaded plugins.

Available plugins

Synto Mobile includes two core plugins:

Token plugin

Token transfers, swaps, balances, and data

DeFi plugin

Lending, borrowing, and loan management

Token plugin

The Token plugin provides comprehensive token and trading capabilities.

Overview

  • Name: token
  • Methods: 12 callable functions
  • Actions: 12 natural language actions
  • Integrations: DexScreener, Jupiter, Solana RPC
Source: utils/syntoUtils/agent/plugins/plugin-token/index.ts:44

Available methods

DexScreener integration:
  • getTokenDataByAddress - Get token info by mint address
  • getTokenAddressFromTicker - Look up address by symbol
Jupiter integration:
  • fetchPrice - Get current token price in USDC
  • stakeWithJup - Stake JUP tokens
  • trade - Execute token swap on Jupiter
These methods connect to external APIs to provide real-time market data.
Check balances:
  • get_balance - Your SOL balance
  • get_balance_other - Another wallet’s SOL balance
  • get_token_balance - Specific SPL token balance
All balance methods return amounts in both lamports and decimal format.
Execute transactions:
  • transfer - Send SOL or SPL tokens
  • closeEmptyTokenAccounts - Reclaim rent from empty accounts
  • request_faucet_funds - Get devnet/testnet SOL
All transaction methods return the transaction signature on success.
Blockchain utilities:
  • getTPS - Current Solana transactions per second
  • getWalletAddress - Your wallet’s public key
These provide helpful blockchain information without executing transactions.

Actions

The Token plugin includes 12 actions triggered by natural language:
Action: TRANSFERTriggers:
  • “send tokens”
  • “transfer funds”
  • “send money”
  • “send sol”
  • “transfer tokens”
Schema:
{
  to: string (min 32 chars),
  amount: number (positive),
  mint?: string (optional)
}
Source: utils/syntoUtils/agent/plugins/plugin-token/solana/actions/transfer.ts:6

Forbidden actions

Some actions are explicitly disabled for safety:
const FORBIDDEN_ACTIONS = ["LAUNCH_PUMPFUN_TOKEN"];
TokenPlugin.actions = TokenPlugin.actions.filter(
  ({ name }) => !FORBIDDEN_ACTIONS.includes(name)
);
Source: utils/syntoUtils/agent/agentBuilder.ts:15
The PumpFun token launch action is disabled to prevent accidental token creation.

DeFi plugin

The DeFi plugin integrates with Rainfi for decentralized lending and borrowing.

Overview

  • Name: defi
  • Methods: 4 callable functions
  • Actions: 4 natural language actions
  • Integrations: Rainfi Protocol
Source: utils/syntoUtils/agent/plugins/plugin-defi/index.ts:18

Rainfi integration

Rainfi is a decentralized lending protocol on Solana that allows:
  • Collateralized loans - Borrow against your crypto
  • Short-term lending - Typically 7-day loan periods
  • Multiple currencies - Support for SOL, USDC, and other tokens
  • Transparent rates - Clear APR and fee structure

Available methods

Method: quoteLoanCalculatorCalculate loan terms before borrowing.Parameters:
{
  amountIn: number,      // Collateral amount
  currencyIn: string,    // Collateral token address
  currencyOut: string,   // Borrow token address
  borrower: string       // Your wallet (auto-filled)
}
Returns:
{
  simulation: {
    amount: number,
    duration: number,
    interest: number,
    rainFees: number,
    apr: number,
    authorization: string,
    bank: string,
    pool: string
  },
  options: { prioritizationFeeLamports: string },
  slippage: number
}
Source: utils/syntoUtils/agent/plugins/plugin-defi/rainfi/actions/quoteLoanCalculator.ts:5

Actions

The DeFi plugin provides 4 natural language actions:

RAINFI_QUOTE_LOAN_CALCULATOR

Triggers:
  • “quote loan calculator”
  • “calculate loan”
  • “get loan quote”
  • “loan quote calculator”

RAINFI_TRANSACTION_BUILDER

Builds loan transactions from quotes

RAINFI_GET_USER_LOANS

Retrieves all your active loans

RAINFI_REPAY_LOAN

Repays loans and reclaims collateral

Loan quote workflow

The typical flow for taking out a loan:
  1. Get quote - Calculate loan terms
  2. Review terms - Agent displays quote for confirmation
  3. Build transaction - Construct the loan transaction
  4. Sign and send - Execute the loan
Important: Always review the loan quote before proceeding. The agent will display all terms including interest rate, fees, and repayment amount.

Plugin initialization

Plugins initialize differently based on their needs:
initialize: function (): void {
  for (const [methodName, method] of Object.entries(this.methods)) {
    if (typeof method === "function") {
      this.methods[methodName] = method;
    }
  }
}
The Token plugin performs simple method registration without binding to the agent.

Creating custom plugins

You can extend the agent with custom plugins:
const customPlugin: Plugin = {
  name: "myPlugin",
  
  methods: {
    myMethod: async (agent: SolanaAgentKit, ...args) => {
      // Your custom logic
      return result;
    }
  },
  
  actions: [
    {
      name: "MY_ACTION",
      similes: ["do something", "perform action"],
      description: "What this action does",
      examples: [[...examples]],
      schema: z.object({...}),
      handler: async (agent, input) => {
        // Action handler
        return result;
      }
    }
  ],
  
  initialize: (agent: SolanaAgentKit) => {
    // Initialization logic
  }
};

// Use your plugin
const agent = agentBuilder(walletFns).use(customPlugin);
Custom plugins must follow the Plugin interface exactly or the agent will reject them.

Plugin best practices

When working with plugins:
Ensure all method names are unique across plugins to avoid conflicts. The agent will throw an error if methods collide.
Use descriptive and distinct similes for actions. Avoid overlapping trigger phrases that could confuse the AI.
Always use Zod schemas to validate action inputs. This prevents runtime errors and provides clear error messages.
Methods should catch errors and return structured responses:
try {
  const result = await doOperation();
  return { status: "success", data: result };
} catch (error) {
  return { 
    status: "error", 
    message: error.message 
  };
}
If your methods need the agent instance, bind them in the initialize function:
initialize: (agent: SolanaAgentKit) => {
  this.methods.myMethod = this.methods.myMethod.bind(null, agent);
}

What’s next

See capabilities

Explore what the plugins can do

Agent overview

Learn about the core architecture

Build docs developers (and LLMs) love