Skip to main content
Glama
AlyssonM

HiveAuth MCP Server

by AlyssonM

revoke_credential

Revoke verifiable credentials by updating their status in the W3C Status List 2021 bitstring. Specify credential ID, status list index, and optional reason for revocation.

Instructions

Revoke a verifiable credential using W3C Status List 2021 specification. Updates the credential status in the bitstring status list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credentialIdYes
statusListIndexYes
reasonNoReason for revocation

Implementation Reference

  • The core handler function that executes the revoke_credential tool. It validates and sanitizes the input using the schema, makes a POST request to the HiveAuth /api/revoke endpoint with credentialId, statusListIndex, and reason, handles the response to format success details or error, and returns a CallToolResult.
    export async function revokeCredential(args: any): Promise<CallToolResult> {
      // Validate and sanitize input
      const validation = validateAndSanitizeInput(RevokeCredentialInputSchema, args, 'revoke_credential');
      
      if (!validation.success) {
        return createValidationErrorResult(validation.error!);
      }
    
      const data = validation.data!;
      const { credentialId, statusListIndex, reason } = data;
    
      const HIVEAUTH_API_BASE_URL = process.env.HIVEAUTH_API_BASE_URL || 'http://localhost:3000';
      const REVOKE_ENDPOINT = `${HIVEAUTH_API_BASE_URL}/api/revoke`;
    
      try {
        const response = await fetch(REVOKE_ENDPOINT, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({ 
            credentialId, 
            statusListIndex,
            reason
          }),
        });
    
        if (!response.ok) {
          const errorData = await response.json().catch(() => ({ message: response.statusText }));
          throw new Error(`Failed to revoke credential: ${errorData.message}`);
        }
    
        const result = await response.json();
    
        const details = [
          `• Credential ID: ${credentialId}`,
          `• Status List Index: ${statusListIndex}`,
          `• Revocation Status: ✅ Successfully revoked`,
          `• Status List Updated: ${result.statusListCredential ? '✅ Yes' : '❌ No'}`
        ];
    
        if (result.statusListCredential?.id) {
          details.push(`• Updated Status List ID: ${result.statusListCredential.id}`);
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `Credential Revocation Result:\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 revoke credential: ${error.message}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema for the revoke_credential tool defining required credentialId (string), statusListIndex (non-negative integer), and optional reason (string). Referenced in TOOL_SCHEMAS.revoke_credential.
    export const RevokeCredentialInputSchema = z.object({
      credentialId: z.string().min(1, 'Credential ID is required'),
      statusListIndex: z.number().int().min(0, 'Status list index must be a non-negative integer'),
      reason: z.string().optional().describe('Reason for revocation')
    });
  • Tool definition entry in TOOL_DEFINITIONS array used by createMCPTools() to generate the MCP Tool object with name, description, and JSON Schema-converted input schema for listTools.
    {
      name: 'revoke_credential',
      description: 'Revoke a verifiable credential using W3C Status List 2021 specification. Updates the credential status in the bitstring status list.',
      inputSchema: TOOL_SCHEMAS.revoke_credential
    },
  • src/index.ts:92-93 (registration)
    Handler dispatch registration in the main CallToolRequest switch statement, calling the revokeCredential function with arguments.
    case 'revoke_credential':
      return await revokeCredential(args);
  • src/index.ts:23-23 (registration)
    Import statement for the revokeCredential handler function used in the MCP server index.
    import { revokeCredential } from './tools/revokeCredential.js';
Behavior2/5

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

With no annotations, the description carries full burden. It discloses the technical method (W3C Status List 2021) and that it updates a status list, which implies mutation. However, it lacks critical behavioral details: whether revocation is permanent/reversible, permission requirements, rate limits, error handling, or what happens to the credential post-revocation. The description is insufficient for a mutation tool with zero annotation coverage.

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 two concise sentences with zero waste. It front-loads the core action and technical specification, efficiently conveying essential information without redundancy or fluff.

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?

Given the complexity of credential revocation (a mutation operation), no annotations, no output schema, and low schema description coverage (33%), the description is incomplete. It lacks details on behavioral implications, parameter meanings, return values, and integration with sibling tools, making it inadequate for safe and 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 33% (only 'reason' has a description). The description adds no parameter-specific semantics beyond what the schema provides—it doesn't explain what 'credentialId' or 'statusListIndex' represent, their formats, or how they relate to the revocation process. With low coverage, the description fails to compensate, but the baseline is 3 as it doesn't mislead.

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 action ('revoke') and resource ('verifiable credential'), specifying the technical method ('using W3C Status List 2021 specification') and outcome ('updates the credential status in the bitstring status list'). It distinguishes from siblings like 'refresh_credential' or 'verify_credential' by focusing on revocation, but doesn't explicitly contrast with them.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description implies it's for revoking credentials, but doesn't mention prerequisites, when not to use it, or how it relates to siblings like 'batch_issue_credentials' or 'verify_credential' in a workflow.

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