fix: TikTok API endpoints and privacy level handling
- Fix publish endpoint: /post/video/init/ → /post/publish/video/init/ - Replace broken /video/list/ with /post/publish/creator_info/query/ - Auto-select valid privacy level from creator options (sandbox fix) - Update tools, manifest, REST routes for creator_info
This commit is contained in:
12
src/tools.ts
12
src/tools.ts
@@ -9,7 +9,7 @@ import { getMe as getTelegramMe, sendMessage as sendTelegramMessage, sendPhoto a
|
||||
import { getMe as getDiscordMe, getGuilds, getChannels, sendMessage as sendDiscordMessage, getMessages as getDiscordMessages } from './clients/discord.js';
|
||||
import { getProfile as getInstagramProfile, getMedia as getInstagramMedia, createImagePost as createInstagramPost, createReel as createInstagramReel } from './clients/instagram.js';
|
||||
import { searchTweets, getUserProfile, getUserTweets, createTweet, uploadVideoAndTweet } from './clients/twitter.js';
|
||||
import { getUserProfile as getTikTokProfile, getUserVideos, createVideo, getVideoStatus } from './clients/tiktok.js';
|
||||
import { getUserProfile as getTikTokProfile, getCreatorInfo, createVideo, getVideoStatus } from './clients/tiktok.js';
|
||||
import { getMe as getSnapchatMe, createSnap, getAdAccounts } from './clients/snapchat.js';
|
||||
import { getPage, getPosts, createPost as createFacebookPost, createPhotoPost, createVideoPost as createFacebookVideoPost } from './clients/facebook.js';
|
||||
|
||||
@@ -577,13 +577,12 @@ export const tools: Tool[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'tiktok_get_videos',
|
||||
name: 'tiktok_get_creator_info',
|
||||
description:
|
||||
'List recent videos from the authenticated TikTok account with view, like, comment, and share counts.',
|
||||
'Get TikTok creator publishing info: username, avatar, available privacy levels, and max video duration. Required before publishing.',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
max_count: { type: 'number', description: 'Max videos to return (default: 10, max: 20)' },
|
||||
account: { type: 'string', description: 'Which TikTok account to use (default: "default")' },
|
||||
},
|
||||
},
|
||||
@@ -1018,9 +1017,8 @@ export async function handleToolCall(
|
||||
}, customer);
|
||||
break;
|
||||
|
||||
case 'tiktok_get_videos':
|
||||
result = await getUserVideos({
|
||||
max_count: (args.max_count as number) ?? 10,
|
||||
case 'tiktok_get_creator_info':
|
||||
result = await getCreatorInfo({
|
||||
account: args.account as string | undefined,
|
||||
}, customer);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user