Skip to main content
Glama
tndfame
by tndfame

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
NameRequiredDescriptionDefault
userIdNoThe user ID to get a profile. Defaults to DESTINATION_USER_ID.U1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p

Implementation Reference

  • 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}`);
        }
      },
    );
  • 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.",
      );
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tndfame/mcp_management'

If you have feedback or need assistance with the MCP directory API, please join our Discord server