set_user_identity
Assign a username and optional email to manage persona attribution and participation in collections within the DollhouseMCP server for dynamic AI persona management.
Instructions
Set your username for persona attribution and collection participation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Your email address (optional) | ||
| username | Yes | Your username (alphanumeric, hyphens, underscores, dots) |
Implementation Reference
- src/persona/PersonaManager.ts:321-333 (handler)Core implementation of user identity setting logic, used by the tool handler. Sets internal state and environment variables for persistence.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/tools/UserTools.ts:11-30 (registration)Defines the tool specification (name, description, inputSchema) and registers the handler function that delegates to server.setUserIdentity. Part of getUserTools export.tool: { name: "set_user_identity", description: "Set your username for persona attribution and collection participation", inputSchema: { type: "object", properties: { username: { type: "string", description: "Your username (alphanumeric, hyphens, underscores, dots)", }, email: { type: "string", description: "Your email address (optional)", }, }, required: ["username"], }, }, handler: (args: any) => server.setUserIdentity(args.username, args?.email) },
- src/types/mcp.ts:52-55 (schema)Zod validation schema for the set_user_identity tool input parameters.export const SetUserIdentityArgsSchema = z.object({ username: z.string().describe("Your username for persona attribution"), email: z.string().optional().describe("Your email address (optional)") });
- src/server/ServerSetup.ts:63-63 (registration)Location where UserTools (including set_user_identity) was registered into the MCP tool registry. Currently commented out as deprecated, replaced by dollhouse_config tool.// this.toolRegistry.registerMany(getUserTools(instance));
- src/server/types.ts:43-43 (helper)TypeScript interface definition for the server.setUserIdentity method called by the tool handler.setUserIdentity(username: string, email?: string): Promise<any>;