Skip to main content
Glama
AlyssonM

HiveAuth MCP Server

by AlyssonM

verify_credential

Verify verifiable credentials by checking signature authenticity, issuer validity, and revocation status to ensure trust and compliance.

Instructions

Verify a verifiable credential for authenticity, integrity, and revocation status. Checks signature, issuer validity, and status list compliance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credentialYesThe verifiable credential to verify

Implementation Reference

  • Core implementation of the verify_credential tool handler. Validates input, calls HiveAuth verification API, formats success/error responses with detailed status and raw JSON output.
    export async function verifyCredential(args: any): Promise<CallToolResult> {
      // Validate and sanitize input
      const validation = validateAndSanitizeInput(VerifyCredentialInputSchema, args, 'verify_credential');
      
      if (!validation.success) {
        return createValidationErrorResult(validation.error!);
      }
    
      const data = validation.data!;
      const { credential } = data;
    
      const HIVEAUTH_API_BASE_URL = process.env.HIVEAUTH_API_BASE_URL || 'http://localhost:3000';
      const VERIFY_ENDPOINT = `${HIVEAUTH_API_BASE_URL}/api/verify`;
    
      try {
        const response = await fetch(VERIFY_ENDPOINT, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({ credential }),
        });
    
        if (!response.ok) {
          const errorData = await response.json().catch(() => ({ message: response.statusText }));
          throw new Error(`Failed to verify credential: ${errorData.message}`);
        }
    
        const result = await response.json();
    
        const statusText = result.verified ? '✅ VERIFIED' : '❌ INVALID';
        const details = [];
    
        if (result.verified) {
          details.push('• Signature verification: ✅ Valid');
          details.push('• Issuer verification: ✅ Valid');
          details.push('• Status check: ✅ Not revoked');
          
          if (result.credential?.validFrom) {
            details.push(`• Valid from: ${result.credential.validFrom}`);
          }
          if (result.credential?.validUntil) {
            details.push(`• Valid until: ${result.credential.validUntil}`);
          }
        } else {
          details.push(`• Error: ${result.message || 'Unknown verification error'}`);
          if (result.errors) {
            result.errors.forEach((error: string) => {
              details.push(`• ${error}`);
            });
          }
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `Credential Verification Result: ${statusText}\n\n${details.join('\n')}`
            },
            {
              type: 'text',
              text: `\`\`\`json\n${JSON.stringify(result, null, 2)}\n\`\`\``
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to verify credential: ${error.message}`
            }
          ],
          isError: true
        };
      }
  • Zod input schema for the verify_credential tool, requiring a verifiable credential object.
    export const VerifyCredentialInputSchema = z.object({
      credential: CredentialSchema.describe('The verifiable credential to verify')
    });
  • Registers the 'verify_credential' tool name, description, and input schema reference in TOOL_DEFINITIONS array used by createMCPTools() to generate MCP Tool objects.
    name: 'verify_credential',
    description: 'Verify a verifiable credential for authenticity, integrity, and revocation status. Checks signature, issuer validity, and status list compliance.',
    inputSchema: TOOL_SCHEMAS.verify_credential
  • src/index.ts:86-87 (registration)
    Dispatches calls to the 'verify_credential' tool by invoking the verifyCredential handler function.
    case 'verify_credential':
      return await verifyCredential(args);
  • Maps the tool name 'verify_credential' to its input schema in TOOL_SCHEMAS lookup object.
    verify_credential: VerifyCredentialInputSchema,
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the verification checks (signature, issuer validity, status list compliance) and the aspects verified (authenticity, integrity, revocation status). However, it lacks details on error handling, performance expectations, or specific constraints like rate limits or authentication requirements.

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 front-loaded and efficient, using two sentences that directly state the tool's purpose and specific checks without redundancy. Every sentence contributes essential information, making it appropriately sized for a single-parameter tool.

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

Completeness3/5

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

Given the complexity (verification with multiple checks), no annotations, and no output schema, the description is moderately complete. It covers what the tool does but lacks details on return values, error cases, or operational constraints, which are important for a verification tool with no structured output documentation.

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%, with the 'credential' parameter well-documented in the schema. The description adds minimal value beyond the schema by implying the credential is the input for verification, but doesn't provide additional context on format expectations or usage nuances, meeting the baseline for high schema coverage.

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's purpose with specific verbs ('verify', 'checks') and resources ('verifiable credential'), and distinguishes it from siblings by focusing on individual credential verification rather than batch operations (batch_verify_credentials), presentation handling (verify_presentation), or credential lifecycle actions (issue, revoke, refresh).

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 usage context through 'verify... for authenticity, integrity, and revocation status,' suggesting it's for validation rather than creation or modification. However, it doesn't explicitly state when to use this versus alternatives like batch_verify_credentials for multiple credentials or verify_presentation for presentations, leaving some ambiguity.

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/AlyssonM/hiveauth-mcp'

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