clear_user_identity
Reset user identity to anonymous mode on DollhouseMCP, enabling dynamic persona switching and privacy restoration for AI interactions.
Instructions
Clear user identity and return to anonymous mode
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/persona/PersonaManager.ts:348-350 (handler)Executes the core logic of clearing the user identity by calling setUserIdentity(null), which unsets the DOLLHOUSE_USER and DOLLHOUSE_EMAIL environment variables via process.env.clearUserIdentity(): void { this.setUserIdentity(null); }
- src/server/tools/UserTools.ts:42-52 (registration)Registers the 'clear_user_identity' MCP tool, providing its name, description, empty input schema, and a handler function that delegates to the server's clearUserIdentity method.{ tool: { name: "clear_user_identity", description: "Clear user identity and return to anonymous mode", inputSchema: { type: "object", properties: {}, }, }, handler: () => server.clearUserIdentity() }
- src/types/mcp.ts:59-59 (schema)Zod schema definition for the input arguments of the clear_user_identity tool (empty object schema since the tool takes no parameters).export const ClearUserIdentityArgsSchema = z.object({});
- Helper method used by clearUserIdentity to set or clear user identity by manipulating process.env variables for DOLLHOUSE_USER and DOLLHOUSE_EMAIL.setUserIdentity(username: string | null, email?: string): void { this.currentUser = username; if (username) { process.env.DOLLHOUSE_USER = username; if (email) { process.env.DOLLHOUSE_EMAIL = email; } } else { delete process.env.DOLLHOUSE_USER; delete process.env.DOLLHOUSE_EMAIL; } }
- src/server/types.ts:45-45 (schema)TypeScript interface definition for the server's clearUserIdentity method, part of IToolHandler.clearUserIdentity(): Promise<any>;