Skip to main content
Glama

Get Score Badge

get_badge
Read-onlyIdempotent

Generate embeddable SVG badges that display Ethereum wallet reputation scores. Returns badge URLs and raw SVG code for integration into websites, documentation, or applications to visualize trust metrics.

Instructions

Get the embeddable SVG badge URL for a wallet's reputation score.

Returns the badge endpoint URL and the raw SVG content. The URL can be embedded in markdown, HTML, or any context that supports images.

This is a FREE endpoint.

Args:

  • wallet (string): Ethereum wallet address

Returns: { badgeUrl, svg }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesEthereum wallet address (e.g. 0xAbC...123)

Implementation Reference

  • The handler function that executes the get_badge tool logic. It constructs the badge URL, makes an API request to fetch the SVG content, and returns the badgeUrl and svg in a JSON response.
    async ({ wallet }) => {
      try {
        const badgeUrl = `${(await import("./client.js")).getConfig().baseUrl}/v1/badge/${wallet}.svg`;
        const svg = await apiRequest<string>({
          path: `/v1/badge/${wallet}.svg`,
        });
        return ok(JSON.stringify({ badgeUrl, svg }, null, 2));
      } catch (error) {
        return err(error);
      }
    }
  • src/tools.ts:259-295 (registration)
    The registration of the 'get_badge' tool with the MCP server. Includes title, description, inputSchema with WalletSchema, and MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint).
      // 6. get_badge ──────────────────────────────────────────────────────
      server.registerTool(
        "get_badge",
        {
          title: "Get Score Badge",
          description: `Get the embeddable SVG badge URL for a wallet's reputation score.
    
    Returns the badge endpoint URL and the raw SVG content. The URL can be
    embedded in markdown, HTML, or any context that supports images.
    
    This is a FREE endpoint.
    
    Args:
      - wallet (string): Ethereum wallet address
    
    Returns:
      { badgeUrl, svg }`,
          inputSchema: { wallet: WalletSchema },
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: true,
          },
        },
        async ({ wallet }) => {
          try {
            const badgeUrl = `${(await import("./client.js")).getConfig().baseUrl}/v1/badge/${wallet}.svg`;
            const svg = await apiRequest<string>({
              path: `/v1/badge/${wallet}.svg`,
            });
            return ok(JSON.stringify({ badgeUrl, svg }, null, 2));
          } catch (error) {
            return err(error);
          }
        }
      );
  • The WalletSchema used for input validation in get_badge and other tools. Validates that the wallet is a valid Ethereum address format (0x + 40 hex characters).
    const WalletSchema = z
      .string()
      .regex(/^0x[a-fA-F0-9]{40}$/, "Must be a valid Ethereum address (0x + 40 hex chars)")
      .describe("Ethereum wallet address (e.g. 0xAbC...123)");
  • Helper functions used by the get_badge handler. ok() formats successful responses, err() formats error responses with proper MCP error structure.
    function ok(text: string) {
      return { content: [{ type: "text" as const, text }] };
    }
    
    function err(error: unknown) {
      return { isError: true as const, content: [{ type: "text" as const, text: formatError(error) }] };
    }
Behavior4/5

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

Annotations already indicate read-only, non-destructive, idempotent behavior. The description adds valuable cost information ('FREE endpoint') and clarifies the return structure includes both the URL and 'raw SVG content', which is not inferable from annotations alone.

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?

Excellent structure with clear sections: purpose, usage context, cost, args, and returns. Front-loaded with the core action. No wasted words; every sentence delivers specific value regarding functionality, cost, or integration method.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of a formal output schema in the structured fields, the description adequately documents the return object structure '{ badgeUrl, svg }'. Combined with good annotations and single-parameter simplicity, the description provides sufficient context for invocation.

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?

With 100% schema description coverage, the baseline is 3. The description repeats the wallet parameter ('Ethereum wallet address') but adds no semantic depth beyond what the schema already provides (which includes the pattern and example format).

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 opening sentence 'Get the embeddable SVG badge URL for a wallet's reputation score' provides a specific verb (Get), resource (SVG badge URL), and scope (wallet reputation). It clearly distinguishes from siblings like score_basic and score_full by emphasizing the embeddable badge aspect rather than raw score data.

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?

Provides explicit context that the URL 'can be embedded in markdown, HTML, or any context that supports images' and notes 'This is a FREE endpoint' (cost guidance). However, it lacks explicit guidance on when to use this versus score_full/score_basic for fetching actual score data rather than visual badges.

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/jacobsd32-cpu/djd-agent-score-mcp'

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