Skip to main content
Glama
olamide-olaniyan

SociaVault MCP Server

get_tiktok_videos

Retrieve TikTok videos from any user profile by providing their username. Access video content and data through the SociaVault social media API integration.

Instructions

Get TikTok videos from a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handleYesTikTok username

Implementation Reference

  • Handler logic for the get_tiktok_videos tool: extracts handle from arguments, makes API request to /tiktok/videos endpoint using axios, processes response with extractTikTokVideos helper, and returns formatted JSON response.
    if (name === "get_tiktok_videos") { const { handle } = args as { handle: string }; const response = await axios.get(`${BASE_URL}/tiktok/videos`, { headers: { "X-API-Key": API_KEY }, params: { handle }, }); const extracted = extractTikTokVideos(response.data, 10); return { content: [ { type: "text", text: JSON.stringify( { handle, videos: extracted, total_returned: extracted.length }, null, 2 ), }, ], }; }
  • src/index.ts:267-277 (registration)
    Tool registration in the tools array, including name, description, and input schema.
    { name: "get_tiktok_videos", description: "Get TikTok videos from a user", inputSchema: { type: "object", properties: { handle: { type: "string", description: "TikTok username" }, }, required: ["handle"], }, },
  • Input schema definition for the get_tiktok_videos tool, specifying the required 'handle' parameter.
    inputSchema: { type: "object", properties: { handle: { type: "string", description: "TikTok username" }, }, required: ["handle"], },
  • Helper function to parse and extract relevant TikTok video data from the API response, limiting to 10 videos.
    function extractTikTokVideos(data: any, limit = 10) { const videos = data?.data?.itemList || data?.itemList || data?.data?.videos || data?.videos || []; return videos.slice(0, limit).map((video: any) => { const stats = video.statistics || video.stats || {}; return { id: video.id || video.aweme_id, description: video.desc || video.description || "", likes: stats.like_count || stats.digg_count || 0, comments: stats.comment_count || 0, shares: stats.share_count || 0, views: stats.play_count || stats.view_count || 0, timestamp: video.create_time || video.timestamp, duration: video.duration, cover: video.cover || video.video?.cover || video.cover_url, }; }); }

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/olamide-olaniyan/sociavault-mcp'

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