Skip to main content
Glama

revoke_delegate

Remove a delegate's permission to transfer tokens from your wallet on the Solana blockchain. Specify the wallet name and token mint address to execute.

Instructions

Revoke a delegate's authority to transfer tokens

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletNameYesName of the wallet that owns the tokens
tokenMintYesToken mint address

Implementation Reference

  • The handler function that executes the revoke_delegate tool. It revokes delegate authority on the associated token account using the SPL token program's revoke instruction.
    async function handleRevokeDelegate(args: any) { const { walletName, tokenMint } = args; const wallet = wallets.get(walletName); if (!wallet) { throw new Error(`Wallet '${walletName}' not found`); } ensureConnection(); const tokenMintPubkey = new PublicKey(tokenMint); const tokenAccount = await getAssociatedTokenAddress( tokenMintPubkey, wallet.keypair.publicKey ); const signature = await revoke( connection, wallet.keypair, tokenAccount, wallet.keypair ); return { success: true, signature, explorerUrl: `https://explorer.solana.com/tx/${signature}?cluster=${currentNetwork}` }; }
  • The input schema and metadata for the revoke_delegate tool, used for validation and listing.
    { name: "revoke_delegate", description: "Revoke a delegate's authority to transfer tokens", inputSchema: { type: "object", properties: { walletName: { type: "string", description: "Name of the wallet that owns the tokens" }, tokenMint: { type: "string", description: "Token mint address" } }, required: ["walletName", "tokenMint"] } }
  • src/index.ts:1357-1358 (registration)
    The switch case that registers and dispatches calls to the revoke_delegate handler in the main CallToolRequestSchema handler.
    case "revoke_delegate": result = await handleRevokeDelegate(args);
  • src/index.ts:1273-1275 (registration)
    The ListToolsRequestSchema handler that registers the tool by returning the tools array containing revoke_delegate.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { 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/ExpertVagabond/solana-mcp-server'

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