fix: MCP server API URL patterns — path params not JSON body, stage name mapping

This commit is contained in:
jlightner 2026-04-03 03:07:39 +00:00
parent f27c18b555
commit fd48435a84

View file

@ -167,8 +167,7 @@ def trigger_pipeline(video_id: str = "", filename: str = "") -> str:
import httpx import httpx
resp = httpx.post( resp = httpx.post(
f"{API_URL}/api/v1/admin/pipeline/trigger", f"{API_URL}/api/v1/admin/pipeline/trigger/{video_id}",
json={"video_id": video_id},
timeout=10, timeout=10,
) )
return _json({ return _json({
@ -214,8 +213,7 @@ def trigger_batch(
for v in videos: for v in videos:
try: try:
resp = httpx.post( resp = httpx.post(
f"{API_URL}/api/v1/admin/pipeline/trigger", f"{API_URL}/api/v1/admin/pipeline/trigger/{v['id']}",
json={"video_id": str(v["id"])},
timeout=10, timeout=10,
) )
results.append({ results.append({
@ -239,8 +237,7 @@ def revoke_pipeline(video_id: str) -> str:
import httpx import httpx
resp = httpx.post( resp = httpx.post(
f"{API_URL}/api/v1/admin/pipeline/revoke", f"{API_URL}/api/v1/admin/pipeline/revoke/{video_id}",
json={"video_id": video_id},
timeout=10, timeout=10,
) )
return _json({ return _json({
@ -258,9 +255,10 @@ def rerun_stage(video_id: str, stage: int) -> str:
import httpx import httpx
stage_name = {2: "stage2_segmentation", 3: "stage3_extraction", 4: "stage4_classification", 5: "stage5_synthesis", 6: "stage6_embed_and_index"}.get(stage, f"stage{stage}")
resp = httpx.post( resp = httpx.post(
f"{API_URL}/api/v1/admin/pipeline/rerun-stage", f"{API_URL}/api/v1/admin/pipeline/rerun-stage/{video_id}/{stage_name}",
json={"video_id": video_id, "stage": stage},
timeout=10, timeout=10,
) )
return _json({ return _json({