Skip to main content
Glama

account_create_implicit_account

Create an implicit account on the NEAR blockchain using a random keypair, where the account ID is derived from the public key. Ideal for adding new access keys to existing accounts.

Instructions

Create an implicit account on the NEAR blockchain. An implicit account is a new random keypair that is not associated with an account ID. Instead the account ID is derived from the public key of the keypair (a 64-character lowercase hexadecimal representation of the public key). This implicit account id can be used just as a regular account id, but remember it is not an official account id with a .near or .testnet suffix. Creating implicit accounts is useful for adding new access keys to an existing account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkIdNomainnet

Implementation Reference

  • Executes the tool logic: generates a random ed25519 keypair, derives the implicit account ID from the base58-decoded public key data converted to lowercase hex, stores the keypair in the local keystore for the specified network, and returns the network ID, implicit account ID, and public key.
      async (args, _) => {
        const keyPair = KeyPair.fromRandom('ed25519');
        const publicKey = keyPair.getPublicKey().toString();
        const implicitAccountIdResult: Result<string, Error> = (() => {
          try {
            return {
              ok: true,
              value: Buffer.from(
                base58.decode(publicKey.split(':')[1]!),
              ).toString('hex'),
            };
          } catch (e) {
            return { ok: false, error: new Error(e as string) };
          }
        })();
        if (!implicitAccountIdResult.ok) {
          return {
            content: [
              { type: 'text', text: `Error: ${implicitAccountIdResult.error}` },
            ],
          };
        }
        const implicitAccountId = implicitAccountIdResult.value;
        await keystore.setKey(args.networkId, implicitAccountId, keyPair);
    
        return {
          content: [
            {
              type: 'text',
              text: stringify_bigint({
                networkId: args.networkId,
                implicitAccountId,
                publicKey,
              }),
            },
          ],
        };
      },
    );
  • Input schema for the tool: requires networkId (testnet or mainnet, defaults to mainnet).
      networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
    },
  • Registers the MCP tool 'account_create_implicit_account' with description, input schema using Zod, and the handler function.
      'account_create_implicit_account',
      noLeadingWhitespace`
      Create an implicit account on the NEAR blockchain. An implicit account is a new random keypair that is not associated with an account ID.
      Instead the account ID is derived from the public key of the keypair (a 64-character lowercase hexadecimal representation of the public key).
      This implicit account id can be used just as a regular account id, but remember *it is not* an official account id with a .near or .testnet suffix.
      Creating implicit accounts is useful for adding new access keys to an existing account.
      `,
      {
        networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
      },
      async (args, _) => {
        const keyPair = KeyPair.fromRandom('ed25519');
        const publicKey = keyPair.getPublicKey().toString();
        const implicitAccountIdResult: Result<string, Error> = (() => {
          try {
            return {
              ok: true,
              value: Buffer.from(
                base58.decode(publicKey.split(':')[1]!),
              ).toString('hex'),
            };
          } catch (e) {
            return { ok: false, error: new Error(e as string) };
          }
        })();
        if (!implicitAccountIdResult.ok) {
          return {
            content: [
              { type: 'text', text: `Error: ${implicitAccountIdResult.error}` },
            ],
          };
        }
        const implicitAccountId = implicitAccountIdResult.value;
        await keystore.setKey(args.networkId, implicitAccountId, keyPair);
    
        return {
          content: [
            {
              type: 'text',
              text: stringify_bigint({
                networkId: args.networkId,
                implicitAccountId,
                publicKey,
              }),
            },
          ],
        };
      },
    );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that this creates a new random keypair and explains the account ID derivation method, but doesn't mention permission requirements, whether the account is immediately usable, rate limits, or what happens to existing keys. It adds some behavioral context but leaves significant gaps for a creation tool.

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 efficiently structured in four sentences: purpose definition, technical explanation of implicit accounts, clarification of limitations, and usage context. Every sentence adds value without redundancy, and key information is front-loaded with the core functionality stated first.

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

Completeness3/5

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

For a creation tool with no annotations and no output schema, the description provides good purpose and usage context but lacks important behavioral details like what the tool returns, whether the account is immediately functional, permission requirements, or error conditions. It's adequate but has clear gaps given the complexity of blockchain account creation.

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

Parameters4/5

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

With 0% schema description coverage and only 1 parameter (networkId with enum values), the description doesn't mention parameters at all. However, since there's only one optional parameter with clear enum values in the schema, the baseline is high. The description focuses on the core functionality rather than parameter details, which is reasonable given the simple parameter structure.

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

Purpose5/5

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

The description clearly states the specific action ('Create an implicit account') and resource ('on the NEAR blockchain'), distinguishing it from siblings like 'account_create_account' by explaining that implicit accounts use derived IDs rather than official .near/.testnet suffixes. It provides precise technical details about keypair generation and account ID derivation.

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

Usage Guidelines4/5

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

The description explicitly states when to use this tool: 'Creating implicit accounts is useful for adding new access keys to an existing account.' It distinguishes from 'account_create_account' by explaining implicit vs. official accounts, but doesn't explicitly mention when NOT to use it or provide alternatives beyond the sibling distinction.

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/nearai/near-mcp'

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