get_profile
Retrieve detailed LINE user profile information including display name, profile picture URL, status message, and language settings to personalize interactions and messaging.
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-46 (handler)The handler function that executes the get_profile tool logic: validates userId, fetches profile from LINE API, handles errors, and returns success or error response.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 for the input parameter 'userId' with default value and description.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)The server.tool call within the register method that registers the 'get_profile' tool with name, description, input 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)Instantiation of GetProfile tool with client and destinationId, and call to its register method on the MCP server.new GetProfile(messagingApiClient, destinationId).register(server);