Skip to main content
Glama

get_account_info_by_private_key

Retrieve Sui blockchain account details by inputting a private key, enabling users to access essential information for wallet management and transactions.

Instructions

Get account info by private key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
privateKeyYes

Implementation Reference

  • The handler function 'cb' that processes the private key input to derive and return account information including public key, private key, and Sui address.
    async cb(args: GetInfoByPrivateKeyParams) {
      if (!args.privateKey) {
        throw new Error('Private key is required');
      }
    
      const keypair = getKeypairFromPrivateKey(args.privateKey) as Ed25519Keypair;
      const publicKey = keypair.getPublicKey().toSuiPublicKey();
      const privateKey = keypair.getSecretKey();
      const address = keypair.toSuiAddress();
    
      const accountInfo = {
        publicKey,
        privateKey,
        address,
      };
    
      return this.createTextResponse(JSON.stringify(accountInfo));
    }
  • Zod input schema defining the required 'privateKey' parameter as a string, along with the corresponding TypeScript type.
    const getInfoByPrivateKeyParamsSchema = z.object({
      privateKey: z.string(),
    });
    
    type GetInfoByPrivateKeyParams = z.output<typeof getInfoByPrivateKeyParamsSchema>;
  • The tool is imported and added to the array of all tools exported from src/tools/index.ts, which is then used by the MCP server for registration.
    import getAccountInfoByPriKeyTool from './account/get-info-by-pri-key.js';
    
    export default [
      faucetTool,
      suiBalanceTool,
      suiTransferTool,
      randomSuiAccountTool,
      genMnemonicTool,
      genSuiAccountsByMnemonicTool,
      getAccountInfoByPriKeyTool,
    ];
  • src/index.ts:6-18 (registration)
    The tools array is imported and each tool is registered to the MCP server using server.tool() in a loop, providing name, description, schema, and callback.
    import tools from './tools/index.js';
    
    // Create an MCP server
    const server = new McpServer({
      name: 'Sui-mcp',
      version: '1.0.0',
    });
    
    for (const tool of tools) {
      const schema = tool.paramsSchema as z.ZodObject<any>;
      const cb = ((args: any) => tool.cb(args)) as any;
      server.tool(tool.name, tool.description, schema.shape, cb);
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states only the action without any details on permissions, security implications (e.g., handling private keys), rate limits, error handling, or what the return value includes. For a tool involving sensitive private key input, this lack of transparency is a significant gap.

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

Conciseness5/5

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

The description is extremely concise with a single sentence, 'Get account info by private key', which is front-loaded and wastes no words. While it may be under-specified, it earns full marks for brevity and lack of redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of handling private keys, the absence of annotations, no output schema, and 0% schema description coverage, the description is severely incomplete. It does not address critical aspects like what 'account info' entails, security warnings, or usage context, making it inadequate for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, with one parameter 'privateKey' undocumented in both schema and description. The description does not add any meaning beyond the parameter name, such as explaining the format (e.g., hex string, mnemonic), validation rules, or security considerations. This fails to compensate for the low coverage, leaving the parameter semantics unclear.

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 'Get account info by private key' is essentially a tautology that restates the tool name with minimal elaboration. It specifies the verb 'Get' and resource 'account info', but lacks specificity about what 'account info' includes or distinguishes this tool from siblings like 'sui-balance' or 'random-sui-account'. The purpose is vague beyond the basic action.

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. The description does not mention prerequisites, context, or exclusions, and it fails to differentiate from sibling tools such as 'sui-balance' (which might retrieve balance info) or 'gen_sui_accounts_by_mnemonic' (which generates accounts). This leaves the agent without direction on appropriate usage scenarios.

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/deanpluse/sui-mcp'

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