Skip to main content
Glama
alberthild

ShieldAPI MCP

by alberthild

shieldapi.check_email

Read-onlyIdempotent

Check if an email address has been exposed in known data breaches via Have I Been Pwned (HIBP) to identify security risks.

Instructions

Check if an email address has been exposed in known data breaches via HIBP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail address to check

Implementation Reference

  • src/index.ts:179-187 (registration)
    The shieldapi.check_email tool is registered dynamically within a loop that iterates over the TOOLS configuration object. The tool handler uses the `callShieldApi` function to fetch data from the ShieldAPI.
    for (const [name, def] of Object.entries(TOOLS)) {
      server.tool(
        name,
        def.description,
        { [def.param]: z.string().describe(def.paramDesc) },
        { ...readOnlyAnnotations, title: TOOL_TITLES[name] || name },
        async (params) => formatResult(await callShieldApi(def.endpoint, params as Record<string, string>))
      );
    }
  • The handler function `callShieldApi` performs the actual API request to the ShieldAPI backend. It handles parameter serialization, demo mode injection, and payment-enabled fetching.
    async function callShieldApi(endpoint: string, params: Record<string, string>): Promise<unknown> {
      const url = new URL(`${SHIELDAPI_URL}/api/${endpoint}`);
      for (const [key, value] of Object.entries(params)) {
        url.searchParams.set(key, value);
      }
      if (demoMode) {
        url.searchParams.set('demo', 'true');
      }
    
      const response = await paymentFetch(url.toString());
      if (!response.ok) {
        const body = await response.text();
        throw new Error(`ShieldAPI ${endpoint} failed (${response.status}): ${body.substring(0, 200)}`);
      }
      return response.json();
    }
  • The schema and configuration for the `shieldapi.check_email` tool, defining the endpoint path and parameter requirements.
      'shieldapi.check_email': {
        description: 'Check if an email address has been exposed in known data breaches via HIBP.',
        param: 'email',
        paramDesc: 'Email address to check',
        endpoint: 'check-email',
      },
    };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare the tool read-only, idempotent, and non-destructive. The description adds valuable context about the data source (HIBP) and the scope ('known data breaches'), which goes beyond the annotations without contradicting them.

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 a single, front-loaded sentence that states the action and resource efficiently with no redundant words or filler.

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?

For a simple one-parameter read-only check tool with robust annotations, this description sufficiently covers purpose, data source, and implied boolean result. No output schema is needed, and the description is complete for the tool's complexity.

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?

The input schema already provides 100% coverage for the single parameter with a clear description ('Email address to check'). The tool description adds no further parameter-level meaning, so the baseline of 3 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 uses the specific verb 'check' with the resource 'email address' and provides context ('exposed in known data breaches via HIBP'), clearly distinguishing this tool from sibling tools that check domains, IPs, or passwords.

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 use for email breach checking, and sibling tool names make alternatives obvious (e.g., check_domain for domains). However, it does not explicitly state when not to use this tool or mention alternatives by name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.