get_profile
Retrieve LINE user profile details including display name, profile picture URL, status message, and language settings for personalized interactions.
Instructions
Get detailed profile information of a LINE user including display name, profile picture URL, status message and language.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | No | The user ID to get a profile. Defaults to DESTINATION_USER_ID. | U1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p |
Implementation Reference
- src/tools/getProfile.ts:35-47 (handler)The handler function that fetches the LINE user profile using the provided userId, handles missing userId errors, and returns formatted success or error responses.async ({ userId }) => { if (!userId) { return createErrorResponse(NO_USER_ID_ERROR); } try { const response = await this.client.getProfile(userId); return createSuccessResponse(response); } catch (error) { return createErrorResponse(`Failed to get profile: ${error.message}`); } }, );
- src/tools/getProfile.ts:22-27 (schema)Zod schema definition for the optional 'userId' input parameter, defaulting to the destination user ID.const userIdSchema = z .string() .default(this.destinationId) .describe( "The user ID to get a profile. Defaults to DESTINATION_USER_ID.", );
- src/tools/getProfile.ts:29-47 (registration)Core registration of the 'get_profile' tool on the MCP server within the GetProfile class's register method, including name, description, schema, and handler.server.tool( "get_profile", "Get detailed profile information of a LINE user including display name, profile picture URL, status message and language.", { userId: userIdSchema, }, async ({ userId }) => { if (!userId) { return createErrorResponse(NO_USER_ID_ERROR); } try { const response = await this.client.getProfile(userId); return createSuccessResponse(response); } catch (error) { return createErrorResponse(`Failed to get profile: ${error.message}`); } }, );
- src/index.ts:65-65 (registration)Instantiates the GetProfile tool with MessagingApiClient and destinationId, then invokes its register method to add the tool to the MCP server.new GetProfile(messagingApiClient, destinationId).register(server);