Solana Agent Building
Quickstart building your agent on Solana.
Adding Solana tools to your agent
You can change your agent's plugin settings by altering the manifest returned by the GET /api/ai-plugin route. Here you can find a tools array in (manifest).'x-mb'.assistant.tools . Add the 'generate-sol-tx' primitive to the tools array like so:
{
//...
'x-mb': {
'account-id': ACCOUNT_ID,
assistant: {
name: 'Solana Assistant',
description:
"An assistant that generates solana transactions.",
instructions:
"You create solana transactions by using the generate-sol-tx tool, which takes a fromPubKey, a toPubKey and an amountInSol and creates a simple SOL transfer.",
tools: [
// Add 'generate-sol-tx' primitive here:
{ type: 'generate-sol-tx' },
//...
],
},
},
//...
}Using the generate-sol-tx tool
The generate-sol-tx tool takes either a base64 encoded transaction or, if you wish to generate a simple SOL transfer, it can also take a fromPubKey(string), a toPubKey(string) and an amountInSol(number) as parameters. To use the second option, simply instruct the agent to use the generate-sol-tx tool when given these three parameters (see instructions in example above).
If you want more flexibility in the types of possible transactions, the base64 encoded transaction is better suited for the job. You can add the transaction building logic to a route and then add the route to the manifest. Here's an example from our agent-boilerplate:
Test and Deploy
Now you can run your agent locally with:
This should open a chat UI where you can ask the agent to make a solana transaction, providing it with the necessary parameters. If the agent isn't calling your tool like expected or isn't picking up on the parameters correctly, try editing the agent's instructions. After, if you wish to have your agent go live, deploy it to your preferred cloud platform (e.g. vercel) and update your agent url in .env:
Alternatively you can add it directly in the manifest's servers list:
Finally, deploy to bitte with make-agent:
This will validate your key, register your agent URL, and then you'll be live!
See also
Bitte Jupiter Agent (by @bh2smith): https://github.com/bh2smith/jupiter-agent
Embeddable Chat Component: https://docs.bitte.ai/agents/embeddable-chat-component
Last updated

