Skip to main content
Glama
123Ergo

unphurl-mcp

get_stats

Retrieve account usage statistics to analyze URL submission breakdown, free rate, score thresholds, and credit balance for cost efficiency insights.

Instructions

View your account usage statistics. Shows total URLs submitted, breakdown by gate (Tranco lookups, cache lookups, pipeline checks), free rate percentage, score threshold counts, and credit balance.

Use this to understand your usage patterns: how many of your checks resolved free (known or cached domains) vs paid pipeline checks, and how many URLs scored above key thresholds.

This is useful for:

  • Checking if your scoring profile is flagging the right proportion of URLs

  • Understanding your cost efficiency (higher free rate = more value per credit)

  • Reporting usage metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration and handler for the 'get_stats' MCP tool. Registers the tool on the server with an empty input schema, and the handler calls api.stats() to fetch account usage statistics. Returns the stats data on success, or appropriate error responses on failure (auth, API error, or unknown error).
      server.registerTool(
        "get_stats",
        {
          description: `View your account usage statistics. Shows total URLs submitted, breakdown by gate (Tranco lookups, cache lookups, pipeline checks), free rate percentage, score threshold counts, and credit balance.
    
    Use this to understand your usage patterns: how many of your checks resolved free (known or cached domains) vs paid pipeline checks, and how many URLs scored above key thresholds.
    
    This is useful for:
    - Checking if your scoring profile is flagging the right proportion of URLs
    - Understanding your cost efficiency (higher free rate = more value per credit)
    - Reporting usage metrics`,
          inputSchema: {},
        },
        async () => {
          if (!api.hasApiKey) return authError();
    
          try {
            const result = await api.stats();
            return successResult(result);
          } catch (err) {
            if (err instanceof ApiRequestError) return apiErrorToResult(err);
            return errorResult(err instanceof Error ? err.message : "Unknown error");
          }
        }
      );
  • TypeScript interface StatsResponse defining the shape of data returned by get_stats. Contains usage breakdown (total_urls_submitted, tranco_lookups, cache_lookups, pipeline_checks_run, free_rate_pct), scoring (checks_above_50, checks_above_75), and account info (credits_remaining, total_credits_purchased, last_active_at).
    export interface StatsResponse {
      usage: {
        total_urls_submitted: number;
        tranco_lookups: number;
        cache_lookups: number;
        pipeline_checks_run: number;
        free_rate_pct: number;
      };
      scoring: {
        checks_above_50: number;
        checks_above_75: number;
      };
      account: {
        credits_remaining: number;
        total_credits_purchased: number;
        last_active_at: string;
      };
    }
  • The UnphurlAPI.stats() method that sends a GET request to /v1/account/stats. This is the actual API call invoked by the get_stats handler.
    async stats(): Promise<StatsResponse> {
      return this.doRequest<StatsResponse>("GET", "/v1/account/stats");
    }
  • src/index.ts:40-45 (registration)
    Registration call in the main index.ts file where registerStatsTool is invoked to add 'get_stats' to the MCP server.
    registerStatsTool(server, api);
    registerAllowlistTools(server, api); // list_allowlist, add_to_allowlist, remove_from_allowlist
    
    // Start the server on stdio
    const transport = new StdioServerTransport();
    await server.connect(transport);
Behavior4/5

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

No annotations provided, but description clearly indicates read-only operation ('View'), though it could explicitly state it's non-destructive.

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?

Concise, front-loaded with purpose, then details, then use cases; every sentence adds value.

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?

Fully describes what the tool does, what it returns, and when to use it; no missing context given lack of output schema.

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?

No parameters in schema, so description does not need to add meaning; baseline of 4 applies.

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 'View your account usage statistics' and enumerates specific metrics, distinguishing it from siblings like get_balance and get_pricing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly lists use cases (understanding usage patterns, cost efficiency, reporting) and implies when to use via contrast with other tools.

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/123Ergo/unphurl-mcp'

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