tiktok_get_post_details
Retrieve comprehensive details from any TikTok post using its video URL. Get creator info, hashtags, engagement metrics, creation date, and video duration.
Instructions
Get the details of a TikTok post.This is used for getting the details of a TikTok post.Supports TikTok video url as input.Returns the details of the video like - Description - Creator username - Hashtags - Number of likes, shares, comments, views and bookmarks - Date of creation - Duration of the video
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tiktok_url | Yes | TikTok video URL, e.g., https://www.tiktok.com/@username/video/1234567890 or https://vm.tiktok.com/1234567890 |
Implementation Reference
- index.ts:212-245 (handler)The performGetPostDetails function executes the core logic for fetching TikTok post details from the TikNeuron API, formats and returns the result as a human-readable string with description, creator, hashtags, likes, shares, comments, views, bookmarks, created_at, and duration.
async function performGetPostDetails(tiktok_url: string) { const url = new URL('https://tikneuron.com/api/mcp/post-detail'); url.searchParams.set('tiktok_url', tiktok_url); const response = await fetch(url, { headers: { 'Accept': 'application/json', 'Accept-Encoding': 'gzip', 'MCP-API-KEY': TIKNEURON_MCP_API_KEY, } }); if (!response.ok) { throw new Error(`TikNeuron API error: ${response.status} ${response.statusText}\n${await response.text()}`); } const data = await response.json() as PostDetails; if (data.details) { const details = data.details; return `Description: ${details.description || 'N/A'} Creator: ${details.creator || 'N/A'} Hashtags: ${Array.isArray(details.hashtags) ? details.hashtags.join(', ') : 'N/A'} Likes: ${details.likes || '0'} Shares: ${details.shares || '0'} Comments: ${details.comments || '0'} Views: ${details.views || '0'} Bookmarks: ${details.bookmarks || '0'} Created at: ${details.created_at || 'N/A'} Duration: ${details.duration || 0} seconds`; } else { return 'No details available'; } } - index.ts:118-132 (schema)PostDetails interface defines the response shape for the tiktok_get_post_details tool, including fields like description, creator, hashtags, likes, shares, comments, views, bookmarks, created_at, and duration.
interface PostDetails { success: boolean; details: { description: string; creator: string; hashtags: string[]; likes: string; // Note: These are strings, not numbers shares: string; comments: string; views: string; bookmarks: string; created_at: string; duration: number; }; } - index.ts:56-79 (registration)GET_POST_DETAILS Tool object definition registers the tool with name 'tiktok_get_post_details', description, and input schema requiring a tiktok_url string.
const GET_POST_DETAILS: Tool = { name: "tiktok_get_post_details", description: "Get the details of a TikTok post." + "This is used for getting the details of a TikTok post." + "Supports TikTok video url as input." + "Returns the details of the video like" + " - Description" + " - Creator username" + " - Hashtags" + " - Number of likes, shares, comments, views and bookmarks" + " - Date of creation" + " - Duration of the video", inputSchema: { type: "object", properties: { tiktok_url: { type: "string", description: "TikTok video URL, e.g., https://www.tiktok.com/@username/video/1234567890 or https://vm.tiktok.com/1234567890", }, }, required: ["tiktok_url"], }, }; - index.ts:249-250 (registration)The ListToolsRequestSchema handler includes GET_POST_DETAILS in the list of available tools, registering it for client discovery.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [AVAILABLE_SUBTITLES, GET_SUBTITLE, GET_POST_DETAILS], - index.ts:289-300 (handler)The CallToolRequestSchema case statement for 'tiktok_get_post_details' routes the request to performGetPostDetails, validates arguments with isGetPostDetailsArgs, and returns the result.
case "tiktok_get_post_details": { if (!isGetPostDetailsArgs(args)) { throw new Error("Invalid arguments for tiktok_get_post_details"); } const { tiktok_url } = args; const results = await performGetPostDetails(tiktok_url); return { content: [{ type: "text", text: results }], isError: false, }; }