validate_key
Test if your IssueBadge API credentials are working correctly by validating authentication keys before issuing badges or certificates.
Instructions
Validate an IssueBadge API key for authentication. Use this to test if your API credentials are working correctly.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | Yes | The API key to validate (usually starts with a number and pipe, e.g., "1|abc123...") |
Implementation Reference
- src/index.ts:415-426 (handler)The main handler for the validate_key tool, which parses input arguments using the schema and calls the apiClient.validateKey method, then formats the result as a text response.case 'validate_key': { const validatedArgs = ValidateKeySchema.parse(args); const result = await apiClient.validateKey(validatedArgs.api_key); return { content: [ { type: 'text', text: `✅ API Key Validation Result:\n\n${JSON.stringify(result, null, 2)}`, }, ], }; }
- src/index.ts:65-67 (schema)Zod schema for validating the input parameters of the validate_key tool.const ValidateKeySchema = z.object({ api_key: z.string().describe('The API key to validate'), });
- src/index.ts:246-259 (registration)Registration of the validate_key tool in the MCP tools list, including name, description, and input schema definition.{ name: 'validate_key', description: 'Validate an IssueBadge API key for authentication. Use this to test if your API credentials are working correctly.', inputSchema: { type: 'object', properties: { api_key: { type: 'string', description: 'The API key to validate (usually starts with a number and pipe, e.g., "1|abc123...")', }, }, required: ['api_key'], }, },
- src/index.ts:174-177 (helper)Helper method in IssueBadgeClient that performs the actual API call to validate the key by posting to '/validate-key' endpoint.async validateKey(apiKey: string): Promise<ApiResponse> { const response = await this.client.post('/validate-key', { api_key: apiKey }); return response.data; }