Skip to main content
Glama

issue_badge

Issue digital badges and certificates to recipients, creating verifiable credentials and sending email notifications with verification links.

Instructions

Issue a badge to a recipient. This creates a digital certificate and sends notification email with verification URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
badge_idYesEncrypted badge ID from badge creation (get this from get_all_badges or create_badge)
nameYesRecipient's full name (will appear on the certificate)
emailNoRecipient's email address (optional, but recommended for notifications)
phoneNoRecipient's phone number (optional)
idempotency_keyYesUnique key to prevent duplicate issuance (e.g., "issue_john_doe_2024_001")
metadataNoCustom field values and additional metadata (e.g., completion_date, score, etc.)

Implementation Reference

  • MCP request handler case for 'issue_badge' tool: parses input with schema, calls IssueBadgeClient.issueBadge, handles success/error response formatting.
    case 'issue_badge': {
      const validatedArgs = IssueBadgeSchema.parse(args);
      const result = await apiClient.issueBadge(validatedArgs);
      
      if (result.success) {
        return {
          content: [
            {
              type: 'text',
              text: `πŸŽ‰ Badge Issued Successfully!\n\nπŸ“§ Recipient: ${validatedArgs.name}\nπŸ†” Issue ID: ${result.IssueId}\nπŸ”— Verification URL: ${result.publicUrl}\n\n${JSON.stringify(result, null, 2)}`,
            },
          ],
        };
      }
      
      return {
        content: [
          {
            type: 'text',
            text: `πŸ“œ Badge Issuance Result:\n\n${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • Core handler logic in IssueBadgeClient: sends POST request to IssueBadge API /issue/create endpoint with provided data.
    async issueBadge(data: z.infer<typeof IssueBadgeSchema>): Promise<IssuedBadge> {
      const response = await this.client.post('/issue/create', data);
      return response.data;
    }
  • Zod schema defining input validation for issue_badge tool parameters.
    const IssueBadgeSchema = z.object({
      badge_id: z.string().describe('Encrypted badge ID from badge creation'),
      name: z.string().describe('Recipient full name'),
      email: z.string().email().optional().describe('Recipient email address'),
      phone: z.string().optional().describe('Recipient phone number'),
      idempotency_key: z.string().describe('Unique key to prevent duplicate issuance'),
      metadata: z.record(z.any()).optional().describe('Custom field values and additional metadata'),
    });
  • src/index.ts:277-312 (registration)
    Tool registration object defining name, description, and JSON inputSchema for the MCP 'issue_badge' tool.
    {
      name: 'issue_badge',
      description: 'Issue a badge to a recipient. This creates a digital certificate and sends notification email with verification URL.',
      inputSchema: {
        type: 'object',
        properties: {
          badge_id: {
            type: 'string',
            description: 'Encrypted badge ID from badge creation (get this from get_all_badges or create_badge)',
          },
          name: {
            type: 'string',
            description: 'Recipient\'s full name (will appear on the certificate)',
          },
          email: {
            type: 'string',
            format: 'email',
            description: 'Recipient\'s email address (optional, but recommended for notifications)',
          },
          phone: {
            type: 'string',
            description: 'Recipient\'s phone number (optional)',
          },
          idempotency_key: {
            type: 'string',
            description: 'Unique key to prevent duplicate issuance (e.g., "issue_john_doe_2024_001")',
          },
          metadata: {
            type: 'object',
            description: 'Custom field values and additional metadata (e.g., completion_date, score, etc.)',
            additionalProperties: true,
          },
        },
        required: ['badge_id', 'name', 'idempotency_key'],
      },
    },
  • TypeScript interface for the IssuedBadge response from the issue_badge API call.
    interface IssuedBadge {
      success: boolean;
      IssueId: string;
      publicUrl: string;
    }

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/issuebadge/mcp-server'

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