get_tiktok_profile
Retrieve TikTok profile data by username to access user information and metrics through the SociaVault MCP Server.
Instructions
Get TikTok profile data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | Yes | TikTok username |
Implementation Reference
- src/index.ts:367-377 (handler)Handler for the get_tiktok_profile tool: makes API call to Sociavault TikTok profile endpoint and extracts data using extractTikTokProfile helper.if (name === "get_tiktok_profile") { const { handle } = args as { handle: string }; const response = await axios.get(`${BASE_URL}/tiktok/profile`, { headers: { "X-API-Key": API_KEY }, params: { handle }, }); const extracted = extractTikTokProfile(response.data); return { content: [{ type: "text", text: JSON.stringify(extracted, null, 2) }], }; }
- src/index.ts:223-233 (registration)Registration of the get_tiktok_profile tool in the tools array, including name, description, and input schema.{ name: "get_tiktok_profile", description: "Get TikTok profile data", inputSchema: { type: "object", properties: { handle: { type: "string", description: "TikTok username" }, }, required: ["handle"], }, },
- src/index.ts:55-69 (helper)Helper function to extract structured TikTok profile data from the API response.function extractTikTokProfile(data: any) { const user = data?.data?.userInfo?.user || data?.user || {}; const stats = data?.data?.userInfo?.stats || user.stats || {}; return { username: user.uniqueId || user.username, nickname: user.nickname, signature: user.signature, followers: stats.followerCount || 0, following: stats.followingCount || 0, likes: stats.heartCount || stats.heart || 0, videos: stats.videoCount || 0, verified: user.verified, avatar: user.avatarLarger || user.avatarMedium, }; }