Skip to main content
Glama

account_create_implicit_account

Generate a random keypair on NEAR to create an implicit account, useful for adding access keys to an existing account.

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

  • Registration of the 'account_create_implicit_account' tool via mcp.tool() call, including its description, input schema (networkId), and handler function.
    mcp.tool(
      '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,
              }),
            },
          ],
        };
      },
    );
  • The handler function for account_create_implicit_account. It generates a random ED25519 keypair, derives the implicit account ID by base58-decoding the public key and converting to hex, stores the keypair in the keystore, 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 account_create_implicit_account: takes a single optional 'networkId' parameter ('testnet' or 'mainnet', defaulting to 'mainnet').
    {
      networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
    },
Behavior3/5

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

With no annotations, the description should disclose behavioral traits. It explains keypair generation and ID derivation, but fails to mention whether the keypair is stored locally, any network interaction, or the output format. This leaves some ambiguity about side effects.

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 a concise paragraph of five sentences. It front-loads the core action and provides useful context. Could be slightly tighter but overall efficient.

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?

Given low complexity (1 param, no output schema), the description covers the concept and use case. However, it lacks details on what the tool returns (e.g., public key/account ID) and whether the keypair is stored. For a simple tool, this is adequate but not complete.

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

Parameters2/5

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

Schema coverage is 0%, and the description does not mention the single parameter (networkId) at all. The enum values are clear from the schema, but the description adds no semantic meaning about the parameter's role or default behavior.

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 tool creates an implicit account on NEAR blockchain, explains what an implicit account is, and distinguishes it from named accounts by noting it lacks .near or .testnet suffix. It differentiates from sibling tool 'account_create_account' by describing the nature of the generated account ID.

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 gives a specific use case: 'useful for adding new access keys to an existing account.' However, it does not explicitly state when not to use this tool or directly compare with alternatives like account_create_account.

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

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