fix(mcp): tell clients to hand the video URL straight to process_video

Connected from claude.ai, Claude tried to open the YouTube URL itself and
then web-searched it before ever calling process_video. The server
instructions and the tool/parameter descriptions now say the URL is passed
through as written and that OpenShorts does the downloading; fetching or
inspecting it first is neither possible nor needed.
This commit is contained in:
juancarlos.cavero 2026-08-27 01:37:43 +02:00
parent 83ad817a31
commit 05ef151bb1

View file

@ -35,11 +35,17 @@ router = APIRouter()
PROTOCOL_VERSIONS = ("2025-06-18", "2025-03-26", "2024-11-05") PROTOCOL_VERSIONS = ("2025-06-18", "2025-03-26", "2024-11-05")
SERVER_INFO = {"name": "openshorts", "title": "OpenShorts", "version": "1.0.0"} SERVER_INFO = {"name": "openshorts", "title": "OpenShorts", "version": "1.0.0"}
INSTRUCTIONS = ( INSTRUCTIONS = (
"OpenShorts turns long videos (YouTube URLs) into viral-ready vertical " "OpenShorts turns long videos (YouTube URLs or direct video files) into "
"clips. Typical flow: process_video -> poll get_job_status until " "viral-ready vertical clips. When the user gives you a video URL, hand it "
"'completed' (a job takes minutes; poll every 30-60s or pass webhook_url) " "to process_video exactly as written: OpenShorts downloads, transcribes "
"-> list_clips -> optionally add_subtitles / publish_clip. Check " "and analyses the video on its own servers. Do NOT try to open, fetch, "
"get_quota before large jobs." "search for, summarise or transcribe the URL yourself first; you cannot "
"reach the video and it is not needed. Typical flow: process_video -> "
"poll get_job_status until 'completed' (a job takes minutes; poll every "
"30-60s or pass webhook_url) -> list_clips -> optionally add_subtitles / "
"recut_clip / publish_clip. Check get_quota before large jobs. The user "
"must own the content or hold the rights: ask once, then pass "
"confirm_rights=true."
) )
# Headers an MCP caller may use to authenticate / bring their own keys; they are # Headers an MCP caller may use to authenticate / bring their own keys; they are
@ -54,11 +60,14 @@ TOOLS = [
"name": "process_video", "name": "process_video",
"title": "Process a video into short clips", "title": "Process a video into short clips",
"description": ( "description": (
"Start clipping a video: downloads the source, transcribes it, finds " "Start clipping a video from its URL. OpenShorts downloads the "
"the most viral moments with AI and renders vertical (9:16) clips " "source itself, transcribes it, finds the most viral moments with AI "
"with captions. Returns a job_id immediately — the work takes " "and renders vertical (9:16) clips with captions. Call this directly "
"minutes; poll get_job_status or pass webhook_url to be called back. " "with the URL the user gave you; do not fetch, search or inspect the "
"The caller must own the content or hold the rights to process it " "URL yourself first (you cannot access the video, and it is not "
"needed). Returns a job_id immediately — the work takes minutes; "
"poll get_job_status or pass webhook_url to be called back. The "
"caller must own the content or hold the rights to process it "
"(confirm_rights)." "(confirm_rights)."
), ),
"inputSchema": { "inputSchema": {
@ -66,7 +75,9 @@ TOOLS = [
"properties": { "properties": {
"source_url": { "source_url": {
"type": "string", "type": "string",
"description": "Public video URL (YouTube or a direct video file URL).", "description": "Public video URL, passed through exactly as the user gave it "
"(YouTube watch/short/live URL, or a direct video file URL). "
"The server does the downloading.",
}, },
"confirm_rights": { "confirm_rights": {
"type": "boolean", "type": "boolean",