ethora-user-login
Authenticate users on the Ethora platform by logging in with email and password. Simplifies user access and integrates with Ethora MCP Server for application management.
Instructions
Login to Ethora with email and password
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | email for login | ||
| password | Yes | password for login |
Implementation Reference
- src/tools.ts:13-27 (handler)The asynchronous handler function for the 'ethora-user-login' tool. It calls the userLogin helper, stringifies the result data, and handles errors by returning a standardized tool response.async function ({ email, password }) { try { let result = await userLogin(email, password) let toolRes: CallToolResult = { content: [{ type: "text", text: JSON.stringify(result.data) }] } return toolRes } catch (error) { let toolRes: CallToolResult = { content: [{ type: "text", text: "error: network error" }] } return toolRes } } )
- src/tools.ts:9-12 (schema)Input schema definition for the 'ethora-user-login' tool using Zod, validating email and password parameters.{ description: 'Login to Ethora with email and password', inputSchema: { email: z.string().email().describe("email for login"), password: z.string().describe("password for login") } },
- src/tools.ts:6-28 (registration)The userLoginWithEmailTool function that registers the 'ethora-user-login' tool on the MCP server, including schema and handler. This function is invoked in registerTools(server).function userLoginWithEmailTool(server: McpServer) { server.registerTool( 'ethora-user-login', { description: 'Login to Ethora with email and password', inputSchema: { email: z.string().email().describe("email for login"), password: z.string().describe("password for login") } }, async function ({ email, password }) { try { let result = await userLogin(email, password) let toolRes: CallToolResult = { content: [{ type: "text", text: JSON.stringify(result.data) }] } return toolRes } catch (error) { let toolRes: CallToolResult = { content: [{ type: "text", text: "error: network error" }] } return toolRes } } ) }
- src/apiClientDappros.ts:103-115 (helper)Helper function performing the actual HTTP POST request to '/users/login-with-email' endpoint, extracts and sets authentication tokens, returns the response. Invoked by the tool handler.export async function userLogin(email: string, password: string) { let resp = await httpClientDappros.post( `/users/login-with-email`, { email, password, } ) let data = resp.data httpTokens.token = data.token httpTokens.refreshToken = data.refreshToken return resp }