Skip to main content
Glama

system_remove_local_account

Removes a local NEAR account from the local keystore, making it unavailable locally without affecting the account on the blockchain.

Instructions

Removes a local NEAR account from the local keystore. Once removed, the account will no longer be available to the user. This does not delete the account from the NEAR blockchain, it only removes the account from the local keystore.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesThe local account id to remove from the local keystore.
networkIdNomainnet

Implementation Reference

  • The tool 'system_remove_local_account' is registered using mcp.tool() with the name passed as the first argument. This is both the registration and the handler since mcp.tool() takes the handler as the callback.
    mcp.tool(
      'system_remove_local_account',
      noLeadingWhitespace`
      Removes a local NEAR account from the local keystore. Once removed, the account
      will no longer be available to the user. This does not delete the account from
      the NEAR blockchain, it only removes the account from the local keystore.`,
      {
        accountId: z
          .string()
          .describe('The local account id to remove from the local keystore.'),
        networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
      },
      async (args, _) => {
        const accountRemovalResult: Result<void, Error> = await (async () => {
          try {
            await keystore.removeKey(args.networkId, args.accountId);
            return { ok: true, value: undefined };
          } catch (e) {
            return { ok: false, error: new Error(e as string) };
          }
        })();
        if (!accountRemovalResult.ok) {
          return {
            content: [
              {
                type: 'text',
                text: `Error: ${accountRemovalResult.error}`,
              },
            ],
          };
        }
        return {
          content: [{ type: 'text', text: `Account removed: ${args.accountId}` }],
        };
      },
    );
  • The handler function for 'system_remove_local_account' - an async callback that takes args (accountId, networkId) and calls keystore.removeKey() to remove the account from the local keystore.
    async (args, _) => {
      const accountRemovalResult: Result<void, Error> = await (async () => {
        try {
          await keystore.removeKey(args.networkId, args.accountId);
          return { ok: true, value: undefined };
        } catch (e) {
          return { ok: false, error: new Error(e as string) };
        }
      })();
      if (!accountRemovalResult.ok) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${accountRemovalResult.error}`,
            },
          ],
        };
      }
      return {
        content: [{ type: 'text', text: `Account removed: ${args.accountId}` }],
      };
    },
  • Input schema for the tool using Zod: accountId (string), networkId (enum of 'testnet'|'mainnet' with default 'mainnet').
    {
      accountId: z
        .string()
        .describe('The local account id to remove from the local keystore.'),
      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 carries full burden. It discloses that removal is local only and does not affect the blockchain, which is critical. However, it does not mention what happens if the account doesn't exist, whether the action is reversible, or any permission requirements.

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 two short sentences, front-loading the core action and adding a clarifying negative statement. No unnecessary words.

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

Completeness4/5

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

For a simple removal tool with no output schema, the description covers the essential 'what it does' and 'what it does not do'. It is complete enough, though it could mention reversibility or error handling.

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?

The accountId parameter is already well-described in the schema. The networkId parameter has enum and default but no description, and the tool description does not add any context for it. With 50% schema coverage, the description does not compensate for the missing parameter details.

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 explicitly states the verb 'removes' and the resource 'local NEAR account from the local keystore', clearly distinguishing it from blockchain deletion. It also differentiates from siblings like system_import_account and system_list_local_keypairs by focusing on removal.

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 implies when to use (when user wants to remove local access) by stating the effect, but does not explicitly state when not to use or provide alternative tools. Given the clear context and opposite siblings, it is still reasonably clear.

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