Skip to main content
Glama

wc_status

Check the status of a WalletConnect session. Retrieve session info including peer wallet, chain, and expiry, or identify if no active session exists.

Instructions

Get WalletConnect session status. Returns session info (peer wallet, chain, expiry) or error if no active session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_idNoTarget wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.

Implementation Reference

  • Handler: registers the wc_status MCP tool. Calls GET /v1/wallet/wc/session with optional wallet_id query param and returns the WalletConnect session status (peer wallet, chain, expiry).
    export function registerWcStatus(
      server: McpServer,
      apiClient: ApiClient,
      walletContext?: WalletContext,
    ): void {
      server.tool(
        'wc_status',
        withWalletPrefix(
          'Get WalletConnect session status. Returns session info (peer wallet, chain, expiry) or error if no active session.',
          walletContext?.walletName,
        ),
        {
          wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'),
        },
        async (args) => {
          const params = new URLSearchParams();
          if (args.wallet_id) params.set('walletId', args.wallet_id);
          const qs = params.toString();
          const result = await apiClient.get('/v1/wallet/wc/session' + (qs ? '?' + qs : ''));
          return toToolResult(result);
        },
      );
    }
  • Registration: import and call to registerWcStatus in createMcpServer, wiring it into the MCP server.
    registerWcStatus(server, apiClient, walletContext);
  • Helper: toToolResult converts ApiResult to MCP CallToolResult format, handling success, session_expired, network_error, and actual API errors.
    export function toToolResult<T>(result: ApiResult<T>): CallToolResult {
      if ('ok' in result && result.ok) {
        return {
          content: [{ type: 'text', text: JSON.stringify(result.data) }],
        };
      }
    
      if ('expired' in result && result.expired) {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              session_expired: true,
              message: result.message,
              action: 'Run waiaas mcp setup to get a new token',
            }),
          }],
          // NO isError (H-04: prevents Claude Desktop from disconnecting)
        };
      }
    
      if ('networkError' in result && result.networkError) {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              network_error: true,
              message: result.message,
            }),
          }],
          // NO isError
        };
      }
    
      // Actual API error -- isError: true
      if ('error' in result) {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              error: true,
              ...result.error,
            }),
          }],
          isError: true,
        };
      }
    
      // Should never happen -- fallback
      return {
        content: [{ type: 'text', text: JSON.stringify({ error: true, message: 'Unknown error' }) }],
        isError: true,
      };
    }
  • Schema: optional wallet_id input parameter defined with Zod (string), used when multi-wallet sessions exist.
      wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'),
    },
  • Helper: withWalletPrefix prepends the wallet name to the tool description for multi-wallet identification.
    export function withWalletPrefix(description: string, walletName?: string): string {
      return walletName ? `[${walletName}] ${description}` : description;
    }
Behavior3/5

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

No annotations provided, so description carries full burden. It mentions auto-resolution for single-wallet sessions but does not explicitly state it's read-only or disclose error behavior details. Adequate but not thorough.

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 concise sentences with front-loaded purpose. No redundant information.

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?

Description indicates return content (session info or error) but lacks specifics on data types or structure. Given no output schema, it's fairly complete for a simple status check.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description covers the wallet_id parameter (100% coverage). The description adds value by explaining 'Required for multi-wallet sessions; auto-resolved when session has a single wallet,' which goes beyond the schema.

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?

Description clearly states 'Get WalletConnect session status' and specifies returned info (peer wallet, chain, expiry) or error. It distinguishes from sibling tools like wc_connect and wc_disconnect.

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?

Context is clear for checking session status, but no explicit when-to-use vs alternatives like list_sessions or when not to use. No exclusions or alternative tool references.

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/minhoyoo-iotrust/WAIaaS'

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