Skip to main content
Glama
getpara
by getpara

wait_for_wallet_ready

Poll a wallet until MPC key generation completes, checking every 2 seconds up to a configurable maximum wait time.

Instructions

Poll a wallet until its status becomes "ready" (MPC key generation complete). Polls every 2 seconds up to a configurable max wait time (default 30s).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletIdYesThe wallet ID to poll
maxWaitMsNoMaximum time to wait in milliseconds (default 30000)

Implementation Reference

  • The handler function implements the polling logic to check the status of a wallet until it is 'ready', 'error', or times out.
    export async function handler(client: ParaClient, args: Record<string, unknown>) {
      const walletId = args.walletId as string;
      const maxWaitMs = (args.maxWaitMs as number) ?? 30_000;
      const pollIntervalMs = 2_000;
    
      const start = Date.now();
    
      while (Date.now() - start < maxWaitMs) {
        const wallet = await client.requestWithRetry<Wallet>(`/v1/wallets/${walletId}`);
    
        if (wallet.status === 'ready') {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(
                  { ...wallet, _note: 'Wallet is ready. You can now use sign_raw to sign data.' },
                  null,
                  2,
                ),
              },
            ],
          };
        }
    
        if (wallet.status === 'error') {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(
                  { ...wallet, _note: 'Wallet creation failed. Try creating a new wallet.' },
                  null,
                  2,
                ),
              },
            ],
            isError: true,
          };
        }
    
        await new Promise((r) => setTimeout(r, pollIntervalMs));
      }
    
      return {
        content: [
          {
            type: 'text' as const,
            text: `Wallet ${walletId} did not become ready within ${maxWaitMs}ms. Current status is still "creating". You can call wait_for_wallet_ready again to keep polling.`,
          },
        ],
        isError: true,
      };
    }
  • The definition object contains the name, description, and input schema for the 'wait_for_wallet_ready' tool.
    export const definition = {
      name: 'wait_for_wallet_ready',
      description:
        'Poll a wallet until its status becomes "ready" (MPC key generation complete). Polls every 2 seconds up to a configurable max wait time (default 30s).',
      inputSchema: {
        type: 'object' as const,
        properties: {
          walletId: {
            type: 'string',
            description: 'The wallet ID to poll',
          },
          maxWaitMs: {
            type: 'number',
            description: 'Maximum time to wait in milliseconds (default 30000)',
          },
        },
        required: ['walletId'],
      },
    };
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so effectively. It discloses key behavioral traits: it's a polling operation (not a one-time check), specifies the polling interval ('every 2 seconds'), mentions a configurable maximum wait time with a default ('default 30s'), and clarifies the success condition ('status becomes "ready"'). This provides clear operational context beyond basic parameters.

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 sentences, front-loaded with the core purpose and followed by operational details. Every word earns its place: no fluff, no repetition, and it efficiently covers polling mechanics, timing, and the success condition in minimal text.

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?

Given the tool's moderate complexity (polling with timing), no annotations, and no output schema, the description is largely complete. It explains what the tool does, how it behaves, and key parameters. However, it lacks details on return values (e.g., what happens on success vs. timeout) and error conditions, which would be needed for a score of 5, especially without an output schema.

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 100%, so the schema already documents both parameters ('walletId' and 'maxWaitMs') with their types and default values. The description adds marginal value by reiterating the default in seconds ('default 30s') and implying 'walletId' is for polling, but does not provide additional semantic context (e.g., format of walletId or behavior if maxWaitMs is exceeded). Baseline 3 is appropriate when schema handles most documentation.

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 ('Poll a wallet'), the target resource ('wallet'), and the precise goal ('until its status becomes "ready" (MPC key generation complete)'). It distinguishes this tool from siblings like 'get_wallet' (which presumably retrieves current state without polling) and 'create_wallet' (which initiates creation).

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 usage context by specifying it's for waiting until a wallet's MPC key generation is complete, suggesting it should be used after wallet creation. However, it does not explicitly state when not to use it (e.g., for non-ready status checks) or name alternatives like 'get_wallet' for immediate status checks, which would be needed for a score of 5.

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/getpara/para-wallet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server