Synto Mobile provides two tool creator functions that convert SolanaAgentKit actions into framework-specific tools for AI integration. These functions enable you to use the agent with popular AI frameworks like LangChain and Vercel AI SDK.Both functions are exported from the main agent module:
import { createLangchainTools, createVercelAITools } from '@/utils/syntoUtils/agent';
These functions automatically handle up to 128 actions. If more actions are provided, only the first 127 will be converted, and a warning will be logged.
{ "TRANSFER": { description: "Transfer SOL or SPL tokens to another wallet...", inputSchema: z.object({ to: z.string(), amount: z.number(), mint: z.string().optional() }) }, "GET_BALANCE": { description: "Get SOL balance for the agent's wallet...", inputSchema: z.object({}) }, // ... more tools}
LangChain tools include rich descriptions with examples:
{ name: "TRANSFER", description: ` Transfer SOL or SPL tokens to another wallet address. Similes: - send tokens - transfer funds - pay someone Examples: Input: { "to": "7xKXtg...", "amount": 0.1 } Output: { "signature": "5j7s..." } Explanation: Transferred 0.1 SOL to the recipient `, schema: z.object({ to: z.string().describe("Recipient wallet address"), amount: z.number().describe("Amount to transfer"), mint: z.string().optional().describe("Token mint address (omit for SOL)") })}
Both functions enforce a maximum of 128 actions (actually 127 due to implementation):
// From vercel-ai/index.ts:9-15if (actions.length > 128) { console.warn( `Too many actions provided. Only a maximum of 128 actions allowed. ` + `You provided ${actions.length}, the last ${actions.length - 128} will be ignored.` );}for (const action of actions.slice(0, 127)) { // Convert action to tool}
If you have more than 128 actions registered across your plugins, only the first 127 will be available to the AI. Consider filtering agent.actions to include only essential operations.