Skip to main content
Glama
gitCarrot

AWS Cognito MCP Server

by gitCarrot

resend_confirmation_code

Resend email confirmation code for AWS Cognito user accounts when the initial verification message is not received or has expired.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • The handler function executes the resend confirmation code logic using AWS CognitoUser.resendConfirmationCode, handling errors and success responses.
    async ({ username }) => { return new Promise((resolve, reject) => { const cognitoUser = new CognitoUser({ Username: username, Pool: userPool }); cognitoUser.resendConfirmationCode((err, result) => { if (err) { reject({ content: [ { type: "text" as const, text: `Failed to resend confirmation code: ${err.message}`, }, { type: "text" as const, text: `Error code: ${(err as any).code || 'Unknown'}`, } ] }); return; } resolve({ content: [ { type: "text" as const, text: "Confirmation code resent successfully", }, { type: "text" as const, text: `Username: ${username}`, }, { type: "text" as const, text: `Delivery method: ${result?.CodeDeliveryDetails?.DeliveryMedium || 'Unknown'}`, }, { type: "text" as const, text: `Destination: ${result?.CodeDeliveryDetails?.Destination || 'Unknown'}`, }, { type: "text" as const, text: `Time: ${new Date().toISOString()}`, } ] }); }); }); }
  • Zod schema defining the input parameter 'username' as a string.
    { username: z.string() },
  • index.ts:790-846 (registration)
    Registration of the 'resend_confirmation_code' tool with server.tool, including name, schema, and inline handler.
    server.tool( "resend_confirmation_code", { username: z.string() }, async ({ username }) => { return new Promise((resolve, reject) => { const cognitoUser = new CognitoUser({ Username: username, Pool: userPool }); cognitoUser.resendConfirmationCode((err, result) => { if (err) { reject({ content: [ { type: "text" as const, text: `Failed to resend confirmation code: ${err.message}`, }, { type: "text" as const, text: `Error code: ${(err as any).code || 'Unknown'}`, } ] }); return; } resolve({ content: [ { type: "text" as const, text: "Confirmation code resent successfully", }, { type: "text" as const, text: `Username: ${username}`, }, { type: "text" as const, text: `Delivery method: ${result?.CodeDeliveryDetails?.DeliveryMedium || 'Unknown'}`, }, { type: "text" as const, text: `Destination: ${result?.CodeDeliveryDetails?.Destination || 'Unknown'}`, }, { type: "text" as const, text: `Time: ${new Date().toISOString()}`, } ] }); }); }); } )

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/gitCarrot/mcp-server-aws-cognito'

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