fix(tiktok-mcp): flag that search_queries returns no videos in the scrape tool

This commit is contained in:
CREDO23 2026-07-10 17:40:04 +02:00
parent 1911b78379
commit 6a0ff1495f

View file

@ -21,7 +21,7 @@ def register(
@mcp.tool( @mcp.tool(
name="surfsense_tiktok_scrape", name="surfsense_tiktok_scrape",
title="Search or scrape TikTok", title="Scrape TikTok videos",
annotations=SCRAPE, annotations=SCRAPE,
structured_output=False, structured_output=False,
) )
@ -51,7 +51,11 @@ def register(
] = None, ] = None,
search_queries: Annotated[ search_queries: Annotated[
list[str] | None, list[str] | None,
Field(description="Terms to search TikTok for, e.g. ['cooking']."), Field(
description="Keyword search terms. Returns no videos — use "
"hashtags/profiles/urls for videos, or the user-search tool for "
"accounts."
),
] = None, ] = None,
results_per_page: Annotated[ results_per_page: Annotated[
int, int,
@ -63,12 +67,13 @@ def register(
workspace: WorkspaceParam = None, workspace: WorkspaceParam = None,
response_format: ResponseFormatParam = "markdown", response_format: ResponseFormatParam = "markdown",
) -> str: ) -> str:
"""Search or scrape public TikTok videos. """Scrape public TikTok videos by hashtag, profile, or URL.
Use this for ANY TikTok research a creator's videos, a hashtag feed, Use for TikTok video research a creator's videos, a hashtag feed, or a
a search, or a specific video URL instead of a generic web search. specific video/profile/hashtag URL instead of a generic web search.
Returns videos with text, author, stats, music, and the web URL. Returns videos with text, author, stats, music, and the web URL. For
Example: hashtags=['food'], max_items=20. accounts by keyword use the user-search tool; keyword search returns no
videos. Example: hashtags=['food'], max_items=20.
""" """
return await run_scraper( return await run_scraper(
client, client,