userDetails
Retrieve comprehensive contact details by providing an email address using this tool. Ideal for managing and analyzing user information on the Mailmodo platform.
Instructions
Tool to get all details of a contact
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes |
Implementation Reference
- Core handler function that performs the API call to retrieve contact details from Mailmodo using the provided email.export async function getContactDetails( mmApiKey: string, email: string ): Promise<any | null> { if (!email) { throw new Error('Email is a required field'); } try { const response = await axios.get<any>( `https://api.mailmodo.com/api/v1/getContactDetails?email=${encodeURIComponent(email)}`, { headers: { 'Accept': 'application/json', 'mmApiKey': mmApiKey || '' } } ); return response.data; } catch (error) { if (error instanceof AxiosError) { return null; } throw new Error('An unexpected error occurred'); } }
- src/server.ts:65-67 (schema)Input schema for the userDetails tool, defining the required 'email' parameter as a string.{ email: z.string(), },
- src/server.ts:62-76 (registration)Registration of the 'userDetails' MCP tool, including description, schema, and inline handler that delegates to getContactDetails and formats the response.server.tool( "userDetails", "Tool to get all details of a contact ", { email: z.string(), }, async ({ email }) => { const details = await getContactDetails(mmApiKey,email); return{ content: [{ type: "text", text: JSON.stringify(details) }] }} );