Skip to main content
Glama

system_remove_local_account

Remove a local NEAR account from the local keystore to restrict user access, while keeping the account active on the NEAR 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

  • Handler function that executes the tool logic: attempts to remove the account key from the local keystore using keystore.removeKey and returns success or error message.
    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}` }],
      };
    },
  • Zod input schema defining parameters: accountId (string) and networkId (enum testnet/mainnet, default mainnet).
    {
      accountId: z
        .string()
        .describe('The local account id to remove from the local keystore.'),
      networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
    },
  • MCP server tool registration for 'system_remove_local_account', including description, input schema, and inline handler function.
      '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}` }],
        };
      },
    );
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 clearly states this is a destructive operation ('removes', 'will no longer be available') and clarifies the scope (local-only, not blockchain deletion). However, it doesn't mention permission requirements, reversibility, or what happens if the account doesn't exist locally.

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?

Two well-structured sentences with zero waste. The first sentence states the core action, the second clarifies the scope. Every word earns its place, and the key information is front-loaded.

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 destructive tool with no annotations and no output schema, the description provides adequate but incomplete context. It covers the purpose and scope well, but lacks information about permissions, error conditions, return values, and doesn't fully compensate for the 50% schema coverage gap.

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 50% (only 'accountId' has a description). The description doesn't add any parameter-specific information beyond what's in the schema. It mentions 'local account' which aligns with 'accountId', but provides no additional context about parameter usage, format, or the 'networkId' parameter.

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 ('removes'), resource ('local NEAR account from the local keystore'), and scope ('does not delete the account from the NEAR blockchain'). It distinguishes from sibling tools like 'account_delete_account' by specifying this only affects local storage.

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

Usage Guidelines3/5

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

The description implies usage when removing local account access, but doesn't explicitly state when to use this vs. alternatives like 'account_delete_account' or 'system_import_account'. It provides some context about the effect being local-only, but lacks explicit guidance on prerequisites or exclusions.

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