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}` }], }; }, );

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