ethora-user-register
Register users on Ethora MCP Server by providing email, first name, and last name. Facilitates user authentication and management within the Ethora platform.
Instructions
Ethora registration with email (required), firstName (required), lastName (required)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | |||
| firstName | Yes | ||
| lastName | Yes |
Implementation Reference
- src/tools.ts:30-64 (handler)The complete tool handler and registration for 'ethora-user-register'. Includes inline input schema validation using Zod and the execution logic that calls the userRegistration API helper, handles errors, and returns appropriate responses.function userRegisterWithEmailTool(server: McpServer) { server.registerTool( 'ethora-user-register', { title: 'Ethora registration', description: 'Ethora registration with email (required), firstName (required), lastName (required)', inputSchema: { email: z.string().email(), firstName: z.string(), lastName: z.string() } }, async function ({ email, firstName, lastName }) { try { await userRegistration(email, firstName, lastName) } catch (error) { if (error && typeof error === 'object' && 'response' in error) { const axiosError = error as any; if (axiosError.response?.status === 422) { const errorData = axiosError.response.data; return { content: [{ type: "text", text: `Error: ${errorData.error}` }] } } } else { return { content: [{ type: "text", text: 'An error occurred during user registration.' }] } } } return { content: [{ type: "text", text: `Operation successful. Please follow the link in your email to complete the registration.` }] } } ) }
- src/tools.ts:33-37 (schema)Input schema for the 'ethora-user-register' tool defining required email, firstName, and lastName with Zod validation.{ title: 'Ethora registration', description: 'Ethora registration with email (required), firstName (required), lastName (required)', inputSchema: { email: z.string().email(), firstName: z.string(), lastName: z.string() } },
- src/tools.ts:30-64 (registration)Registration of the 'ethora-user-register' tool via server.registerTool call within userRegisterWithEmailTool, which is invoked in registerTools.function userRegisterWithEmailTool(server: McpServer) { server.registerTool( 'ethora-user-register', { title: 'Ethora registration', description: 'Ethora registration with email (required), firstName (required), lastName (required)', inputSchema: { email: z.string().email(), firstName: z.string(), lastName: z.string() } }, async function ({ email, firstName, lastName }) { try { await userRegistration(email, firstName, lastName) } catch (error) { if (error && typeof error === 'object' && 'response' in error) { const axiosError = error as any; if (axiosError.response?.status === 422) { const errorData = axiosError.response.data; return { content: [{ type: "text", text: `Error: ${errorData.error}` }] } } } else { return { content: [{ type: "text", text: 'An error occurred during user registration.' }] } } } return { content: [{ type: "text", text: `Operation successful. Please follow the link in your email to complete the registration.` }] } } ) }
- src/apiClientDappros.ts:92-101 (helper)Supporting API client function userRegistration that performs the HTTP POST to the backend endpoint for user sign-up.export function userRegistration(email: string, firstName: string, lastName: string) { return httpClientDappros.post( `/users/sign-up-with-email/`, { email, firstName, lastName } ) }