get_my_profile
Retrieve your user profile details from the EventHorizon platform to access personal information and manage your account settings.
Instructions
Get the current user's profile information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:306-334 (handler)Full MCP tool definition including registration, empty input schema, and inline handler function that retrieves and formats the current user's profile using the EventHorizonClient.server.tool( 'get_my_profile', 'Get the current user\'s profile information.', {}, async () => { try { const apiClient = getClient(); const profile = await apiClient.getCurrentProfile(); return { content: [{ type: 'text', text: `User Profile: Username: ${profile.username} Email: ${profile.email} Name: ${profile.first_name} ${profile.last_name} Bio: ${profile.profile.bio || 'Not set'} Location: ${profile.profile.location || 'Not set'} Phone: ${profile.profile.phone_number || 'Not set'} Joined: ${profile.date_joined}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
- src/api-client.ts:192-199 (helper)Helper method in EventHorizonClient that performs the API request to fetch the current user's profile from '/accounts/api/me/'.async getCurrentProfile(): Promise<User & { profile: Profile }> { try { const response: AxiosResponse<User & { profile: Profile }> = await this.client.get('/accounts/api/me/'); return response.data; } catch (error) { throw new Error(`Failed to get user profile: ${getErrorMessage(error)}`); } }
- src/api-client.ts:5-20 (schema)TypeScript interfaces defining the structure of User and Profile data returned by the getCurrentProfile API call, used for type safety in the tool handler.export interface User { id: number; username: string; email: string; first_name: string; last_name: string; date_joined: string; } export interface Profile { bio: string; location: string; phone_number: string; avatar: string; social_links: SocialLink[]; }