Skip to main content
Glama

wrap_edu

Convert EDU tokens to WEDU (Wrapped EDU) for enhanced interoperability and compatibility with decentralized platforms. Enter your wallet’s private key and the amount to wrap.

Instructions

Wrap EDU to WEDU (Wrapped EDU)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount of EDU to wrap
privateKeyYesPrivate key of the wallet

Implementation Reference

  • The core handler function that executes the wrapping of EDU to WEDU by depositing into the WETH9 (WEDU) contract.
    export async function wrapEDU(
      privateKey: string,
      amount: string
    ): Promise<{
      hash: string;
      from: string;
      amount: string;
      success: boolean;
    }> {
      try {
        const provider = blockchain.getProvider();
        const wallet = new ethers.Wallet(privateKey, provider);
        const fromAddress = wallet.address;
        
        // Convert EDU amount to wei
        const amountInWei = ethers.parseEther(amount);
        
        // Create WETH9 contract instance
        const wethAbi = [
          'function deposit() external payable',
          'function withdraw(uint256 amount) external',
          'function balanceOf(address owner) view returns (uint256)',
          'function approve(address spender, uint256 amount) external returns (bool)'
        ];
        
        const wethContract = new ethers.Contract(CONTRACTS.WETH9, wethAbi, wallet);
        
        // Deposit EDU to get WEDU
        const tx = await wethContract.deposit({ value: amountInWei });
        const receipt = await tx.wait();
        
        if (!receipt) {
          throw new Error('Transaction failed');
        }
        
        return {
          hash: tx.hash,
          from: fromAddress,
          amount,
          success: true
        };
      } catch (error) {
        console.error('Error wrapping EDU to WEDU:', error);
        throw error;
      }
    }
  • The input schema definition for the 'wrap_edu' tool, specifying parameters privateKey and amount.
      name: 'wrap_edu',
      description: 'Wrap EDU to WEDU (Wrapped EDU)',
      inputSchema: {
        type: 'object',
        properties: {
          privateKey: {
            type: 'string',
            description: 'Private key of the wallet',
          },
          amount: {
            type: 'string',
            description: 'Amount of EDU to wrap',
          },
        },
        required: ['privateKey', 'amount'],
      },
    },
  • src/index.ts:1401-1441 (registration)
    The registration and dispatch logic in the MCP tool call handler that validates inputs and calls the wrapEDU handler from the swap module.
    case 'wrap_edu': {
      if (!args.privateKey || typeof args.privateKey !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Private key is required');
      }
      
      if (!args.amount || typeof args.amount !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Amount is required');
      }
      
      try {
        const result = await swap.wrapEDU(args.privateKey, args.amount);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                ...result,
                message: `Successfully wrapped ${args.amount} EDU to WEDU`,
                note: "WEDU (Wrapped EDU) is required for interacting with SailFish DEX. You can unwrap it back to EDU at any time."
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        console.error('Error wrapping EDU to WEDU:', error);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ 
                error: 'Failed to wrap EDU to WEDU',
                message: (error as Error).message
              }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but fails to disclose behavioral traits. It doesn't indicate if this is a read-only or mutating operation (implied mutation from 'wrap'), potential costs (e.g., gas fees), security implications of providing a private key, or what happens on success/failure. Critical details like transaction finality or error handling are omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very brief and front-loaded, with no wasted words. However, it's overly concise to the point of under-specification, as it lacks necessary operational details. While structurally efficient, it sacrifices clarity for brevity.

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 blockchain token-wrapping operation with no annotations and no output schema, the description is incomplete. It doesn't explain the purpose, behavior, or expected outcomes, leaving gaps in understanding how the tool functions or what it returns. More context is needed for safe and effective use.

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?

Schema description coverage is 100%, with clear parameter descriptions in the schema itself. The tool description adds no additional meaning beyond the schema, such as explaining the format of 'amount' (e.g., in wei or decimals) or security notes for 'privateKey'. Since the schema is well-documented, the baseline score of 3 applies.

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

Purpose2/5

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

The description 'Wrap EDU to WEDU (Wrapped EDU)' restates the tool name 'wrap_edu' in slightly different words, making it tautological. It doesn't specify what 'wrap' means operationally (e.g., converting native EDU tokens to wrapped WEDU tokens on a blockchain) or distinguish it from sibling tools like 'unwrap_wedu' beyond the obvious directionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing EDU balance), related tools like 'unwrap_wedu' for reverse operations, or scenarios where wrapping is beneficial (e.g., for DeFi interactions). The description offers no context for usage decisions.

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

Related 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/SailFish-Finance/educhain-ai-agent-kit'

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