add_user
Add or update a user by providing their email and optional name on the TeamRetro MCP Server, facilitating user management for retrospective sessions.
Instructions
Add or update a user by email
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | |||
| name | No |
Implementation Reference
- src/features/users/tools.ts:25-35 (handler)The handler function for the MCP 'add_user' tool. It extracts email, name, and emailAddress from args and calls usersService.addUser, wrapping the result with createToolResponse.handler: async (args: { email: string; name: string | null; emailAddress: string; }) => createToolResponse( usersService.addUser(args.email, { name: args.name, emailAddress: args.emailAddress, }) ),
- src/features/users/tools.ts:20-23 (schema)Zod input schema for the 'add_user' tool defining required email and optional name. Note: handler expects additional emailAddress not in schema.schema: z.object({ email: emailSchema, name: nameSchema.optional(), }),
- src/tools.ts:13-22 (registration)Registration of userTools (which includes 'add_user') into the main tools object, which is then used to generate toolSchema and toolHandlers for MCP.const tools = { ...userTools, ...teamTools, ...teamMembersTools, ...actionTools, ...retrospectiveTools, ...agreementTools, ...healthModelTools, ...healthCheckTools, };
- src/features/users/service.ts:33-40 (helper)The supporting usersService.addUser method that performs a PUT request to `/v1/users/{email}` with the user data to add or update the user.async addUser( email: string, userData: { name: string | null; emailAddress: string } ): Promise<SingleApiResponse<User>> { return this.put<SingleApiResponse<User>>(`/v1/users/${email}`, { body: userData, }); }