Skip to main content
Glama
AlyssonM

HiveAuth MCP Server

by AlyssonM

verify_presentation

Validate verifiable presentations by checking signatures, verifying holders, and confirming all included credentials for authentication in the HiveAuth ecosystem.

Instructions

Verify a verifiable presentation containing multiple credentials. Validates presentation signature, holder verification, and all included credentials.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
presentationYesThe verifiable presentation to verify

Implementation Reference

  • The main handler function that executes the verify_presentation tool logic. It validates the input presentation, calls the HiveAuth API endpoint to verify it, processes the response, and returns formatted results including status and details.
    export async function verifyPresentation(args: any): Promise<CallToolResult> {
      // Validate and sanitize input
      const validation = validateAndSanitizeInput(VerifyPresentationInputSchema, args, 'verify_presentation');
      
      if (!validation.success) {
        return createValidationErrorResult(validation.error!);
      }
    
      const data = validation.data!;
      const { presentation } = data;
    
      const HIVEAUTH_API_BASE_URL = process.env.HIVEAUTH_API_BASE_URL || 'http://localhost:3000';
      const VERIFY_PRESENTATION_ENDPOINT = `${HIVEAUTH_API_BASE_URL}/api/verify-presentation`;
    
      try {
        const response = await fetch(VERIFY_PRESENTATION_ENDPOINT, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({ presentation }),
        });
    
        if (!response.ok) {
          const errorData = await response.json().catch(() => ({ message: response.statusText }));
          throw new Error(`Failed to verify presentation: ${errorData.message}`);
        }
    
        const result = await response.json();
    
        const statusText = result.verified ? '✅ VERIFIED' : '❌ INVALID';
        const details = [];
    
        if (result.verified) {
          details.push('• Presentation signature: ✅ Valid');
          details.push('• Holder verification: ✅ Valid');
          
          const credentialCount = presentation.verifiableCredential?.length || 0;
          details.push(`• Credentials verified: ${credentialCount}`);
          
          if (result.credentialResults) {
            result.credentialResults.forEach((credResult: any, index: number) => {
              const credStatus = credResult.verified ? '✅' : '❌';
              details.push(`  - Credential ${index + 1}: ${credStatus} ${credResult.verified ? 'Valid' : 'Invalid'}`);
            });
          }
        } 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: `Presentation 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 presentation: ${error.message}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema definition for the verify_presentation tool, validating the required 'presentation' field using the PresentationSchema.
    export const VerifyPresentationInputSchema = z.object({
      presentation: PresentationSchema.describe('The verifiable presentation to verify')
    });
  • src/index.ts:89-90 (registration)
    Registration of the verify_presentation tool in the main MCP server request handler switch statement, dispatching to the verifyPresentation handler function.
    case 'verify_presentation':
      return await verifyPresentation(args);
  • MCP Tool definition registration in TOOL_DEFINITIONS array, providing name, description, and input schema reference for automatic conversion to MCP tool format via createMCPTools().
    name: 'verify_presentation',
    description: 'Verify a verifiable presentation containing multiple credentials. Validates presentation signature, holder verification, and all included credentials.',
    inputSchema: TOOL_SCHEMAS.verify_presentation
  • Mapping of tool name to its input schema in the TOOL_SCHEMAS constant, used for schema lookup in tool definitions.
    verify_presentation: VerifyPresentationInputSchema,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what gets validated but doesn't describe the verification process, success/failure conditions, error handling, or output format. For a verification tool with complex input and no output schema, this leaves significant gaps in understanding how the tool behaves and what results to expect.

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, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action and specifies the validation targets clearly, making every word earn its place. No structural issues or redundancy are present.

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

Completeness2/5

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

For a verification tool with complex nested input (presentation object with credentials) and no output schema, the description is insufficient. It doesn't explain what constitutes successful verification, what the output looks like, or how errors are handled. Given the technical nature of verifiable presentations and multiple sibling tools, more context is needed for effective use.

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 single parameter 'presentation' having a clear description in the schema. The description adds no additional parameter information beyond what's already documented in the schema, so it meets the baseline for high schema coverage but doesn't provide extra value like format examples or validation nuances.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('verify') and resource ('verifiable presentation containing multiple credentials'), making the purpose unambiguous. It specifies what gets validated: presentation signature, holder verification, and all included credentials. However, it doesn't explicitly differentiate from sibling tools like 'verify_credential' or 'evaluate_presentation', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'verify_credential' (for single credentials) or 'evaluate_presentation' (which appears related). It doesn't mention prerequisites, such as needing a properly formatted presentation object, or when this verification is appropriate versus other validation tools in the sibling list.

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