Skip to main content
Glama

profile_wallet

Generate a full portfolio profile for an Ethereum or Base wallet address, including token holdings, NFTs, DeFi positions, transaction summary, PnL, and risk score, paid per call via micropayment.

Instructions

Generate a full portfolio profile for an Ethereum/Base wallet address. Returns token holdings, NFTs, DeFi positions, transaction history summary, PnL estimate, and risk profile score. Costs 0.008 USDC per call (x402 micropayment on Base).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum or Base wallet address (0x...)
chainNoFilter by chain (e.g. "ethereum", "base", "arbitrum", "polygon"). Defaults to "all".

Implementation Reference

  • src/index.ts:395-416 (registration)
    Tool definition registration for 'profile_wallet' in the TOOLS array. Defines name, description, input schema (address required, chain optional), and cost info (0.008 USDC).
    {
      name: 'profile_wallet',
      description:
        'Generate a full portfolio profile for an Ethereum/Base wallet address. ' +
        'Returns token holdings, NFTs, DeFi positions, transaction history summary, ' +
        'PnL estimate, and risk profile score. ' +
        'Costs 0.008 USDC per call (x402 micropayment on Base).',
      inputSchema: {
        type: 'object',
        properties: {
          address: {
            type: 'string',
            description: 'Ethereum or Base wallet address (0x...)',
          },
          chain: {
            type: 'string',
            description: 'Filter by chain (e.g. "ethereum", "base", "arbitrum", "polygon"). Defaults to "all".',
          },
        },
        required: ['address'],
      },
    },
  • Handler case for 'profile_wallet' in the CallToolRequestSchema switch. Validates required 'address' param, then delegates to callApi('GET /api/wallet-profiler') with address and optional chain query params.
    case 'profile_wallet':
      if (!params.address) {
        throw new McpError(ErrorCode.InvalidParams, 'profile_wallet requires: address');
      }
      result = await callApi('/api/wallet-profiler', {
        address: params.address,
        chain: params.chain,
      });
      break;
  • Generic API call helper that builds the URL, executes via the x402-aware fetch (with auto-pay support), handles 402 payment responses, and returns structured ApiResponse.
    async function callApi(
      endpoint: string,
      params: Record<string, string | number | undefined> = {}
    ): Promise<ApiResponse> {
      const url = new URL(`${API_BASE_URL}${endpoint}`);
      for (const [key, value] of Object.entries(params)) {
        if (value !== undefined && value !== '') {
          url.searchParams.set(key, String(value));
        }
      }
    
      const fetchFn = await getX402Fetch();
    
      let response: Response;
      const controller = new AbortController();
      const fetchTimeout = setTimeout(() => controller.abort(), 30_000);
      try {
        response = await fetchFn(url.toString(), {
          headers: {
            'Accept': 'application/json',
            'User-Agent': `x402-api-mcp/${SERVER_VERSION}`,
          },
          signal: controller.signal,
        });
      } catch (err) {
        const isTimeout = err instanceof Error && err.name === 'AbortError';
        throw new McpError(
          ErrorCode.InternalError,
          isTimeout
            ? `Request to ${endpoint} timed out after 30 seconds`
            : `Network error calling ${endpoint}: ${err instanceof Error ? err.message : String(err)}`
        );
      } finally {
        clearTimeout(fetchTimeout);
      }
    
      if (response.status === 402) {
        // Clone before reading so we can fall back to text() if JSON parsing fails.
        // Without the clone, calling response.json() consumes the body; a subsequent
        // response.text() call then throws "body already used".
        const cloned = response.clone();
        let paymentDetails: unknown;
        try {
          paymentDetails = await response.json();
        } catch {
          paymentDetails = await cloned.text();
        }
        return { status: 402, data: null, paymentRequired: true, paymentDetails };
      }
    
      if (!response.ok) {
        const errorText = await response.text();
        if (response.status === 400 || response.status === 422) {
          throw new McpError(
            ErrorCode.InvalidParams,
            `Invalid request to ${endpoint}: ${errorText}`
          );
        }
        throw new McpError(
          ErrorCode.InternalError,
          `API error ${response.status} from ${endpoint}: ${errorText}`
        );
      }
    
      const data = await response.json();
      return { status: response.status, data };
    }
Behavior2/5

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

No annotations provided, so the description bears full burden. It discloses the cost (0.008 USDC per call) but lacks information on side effects, authentication requirements, rate limits, or error behavior. The read-only nature is implied but not stated.

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: first sentence defines purpose and outputs, second sentence states cost. It is front-loaded with no extraneous information, earning every word.

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?

The description lists all major output categories (token holdings, NFTs, DeFi positions, tx history summary, PnL estimate, risk profile score), which is sufficient given no output schema. However, it could note the time range for history or that it's a snapshot, but this is minor.

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 describes the parameters. The description adds value by noting the cost, but does not provide additional parameter-specific context beyond what the schema offers.

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 tool generates a full portfolio profile for an Ethereum/Base wallet address and lists specific outputs (token holdings, NFTs, DeFi positions, etc.), making it distinct from sibling tools like get_crypto_prices or scan_token.

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 for wallet profiling but provides no explicit guidance on when to choose this over siblings (e.g., scan_token for single token analysis) or when not to use it. Context signals show sibling tools cover different functions, but no exclusions are stated.

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/fernsugi/x402-api-mcp-server'

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