Skip to main content
Glama
gitCarrot

AWS Cognito MCP Server

by gitCarrot

delete_user

Remove a user from AWS Cognito user pool to manage access control and maintain user directory integrity by deleting user accounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:711-712 (registration)
    Registration of the 'delete_user' tool using server.tool()
    server.tool( "delete_user",
  • Empty input schema for delete_user tool (no input parameters required)
    { },
  • Handler function for the delete_user tool. It retrieves the current Cognito user, verifies the session, extracts the username, calls cognitoUser.deleteUser(), and returns success or error messages.
    async ({}) => { return new Promise((resolve, reject) => { const cognitoUser = userPool.getCurrentUser(); if (!cognitoUser) { resolve({ content: [ { type: "text" as const, text: "No user currently signed in", } ] }); return; } cognitoUser.getSession((err: Error | null, _session: CognitoUserSession) => { if (err) { reject({ content: [ { type: "text" as const, text: `Error getting session: ${err.message}`, } ] }); return; } const username = cognitoUser.getUsername(); cognitoUser.deleteUser((err, result) => { if (err) { reject({ content: [ { type: "text" as const, text: `Failed to delete user: ${err.message}`, }, { type: "text" as const, text: `Error code: ${(err as any).code || 'Unknown'}`, } ] }); return; } resolve({ content: [ { type: "text" as const, text: "User deleted successfully", }, { type: "text" as const, text: `Username: ${username}`, }, { type: "text" as const, text: `Result: ${result}`, }, { 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