Skip to main content
Glama
gitCarrot

AWS Cognito MCP Server

by gitCarrot

resend_confirmation_code

Resend confirmation codes for AWS Cognito users who need to verify their accounts after sign-up or when codes expire.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • The handler function for the 'resend_confirmation_code' tool. It creates a CognitoUser instance for the given username and calls resendConfirmationCode to send a new confirmation code via email or other delivery method.
        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 for input validation, requiring a 'username' string.
    {
        username: z.string()
    },
  • index.ts:790-791 (registration)
    Registration of the tool with MCP server using server.tool(), specifying name, schema, and handler.
    server.tool(
        "resend_confirmation_code",

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