Skip to main content
Glama

system_list_local_keypairs

Retrieve and display NEAR accounts and their associated keypairs stored locally for a specified network (testnet or mainnet).

Instructions

List all NEAR accounts and their keypairs in the local keystore by network.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkIdNomainnet

Implementation Reference

  • The handler function that executes the tool logic: fetches accounts from the local keystore and retrieves their public keys for the given network.
    async (args, _) => {
      const keyPairs = await keystore.getAccounts(args.networkId);
      const result = {
        networkId: args.networkId,
        keypairs: await Promise.all(
          keyPairs.map(async (accountId) => ({
            accountId,
            publicKey: (await keystore.getKey(args.networkId, accountId))
              .getPublicKey()
              .toString(),
          })),
        ),
      };
      return {
        content: [{ type: 'text', text: stringify_bigint(result) }],
      };
    },
  • Zod input schema defining the networkId parameter (testnet or mainnet, defaults to mainnet).
    {
      networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
    },
  • Registration of the tool using mcp.tool(), including name, description, schema, and inline handler.
    mcp.tool(
      'system_list_local_keypairs',
      'List all NEAR accounts and their keypairs in the local keystore by network.',
      {
        networkId: z.enum(['testnet', 'mainnet']).default('mainnet'),
      },
      async (args, _) => {
        const keyPairs = await keystore.getAccounts(args.networkId);
        const result = {
          networkId: args.networkId,
          keypairs: await Promise.all(
            keyPairs.map(async (accountId) => ({
              accountId,
              publicKey: (await keystore.getKey(args.networkId, accountId))
                .getPublicKey()
                .toString(),
            })),
          ),
        };
        return {
          content: [{ type: 'text', text: stringify_bigint(result) }],
        };
      },
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a list operation, implying it's read-only and non-destructive, but doesn't disclose behavioral traits like whether it requires specific permissions, how results are formatted, if there are rate limits, or what happens with empty keystores. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that front-loads the core purpose ('List all NEAR accounts and their keypairs') and adds necessary context ('in the local keystore by network'). There's no wasted wording, and every part of the sentence contributes directly to understanding the tool's function.

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 the tool's low complexity (one optional parameter with enum), no annotations, and no output schema, the description is minimally adequate. It covers what the tool does but lacks details on behavior, output format, or error conditions. For a simple list tool, this is passable but leaves room for improvement in contextual richness.

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 description mentions 'by network', which aligns with the single parameter 'networkId' in the schema. However, schema description coverage is 0%, so the description doesn't add details beyond the parameter's existence. It doesn't explain the enum values (testnet/mainnet) or the default (mainnet), leaving the schema to carry most of the semantic weight. With one parameter and low coverage, this meets the baseline.

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

Purpose4/5

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

The description clearly states the verb 'List' and the resource 'NEAR accounts and their keypairs in the local keystore', with the scope 'by network'. It distinguishes from siblings like account_list_access_keys (which lists access keys for a specific account) and system_import_account/remove_local_account (which modify rather than list). However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.

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 needing to list local accounts/keypairs by network, but doesn't explicitly state when to use this tool versus alternatives like account_view_account_summary (which shows details for a single account) or account_list_access_keys. No exclusions or prerequisites are mentioned, leaving usage context somewhat implied rather than explicit.

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