zapcap_mcp_upload_video
Upload video files to ZapCap for processing tasks using the MCP server's API integration.
Instructions
Upload video file to ZapCap
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Implementation Reference
- src/zapcap_mcp_server/server.py:55-70 (handler)The handler function for 'zapcap_mcp_upload_video' tool. Uploads a local video file to the ZapCap API using HTTP POST with file upload, authenticated via API key.@mcp.tool(description="Upload video file to ZapCap") def zapcap_mcp_upload_video(request: UploadVideo) -> Dict[str, Any]: headers = {"x-api-key": get_api_key()} with open(request.file_path, 'rb') as f: files = {'file': f} with httpx.Client() as client: response = client.post( "https://api.zapcap.ai/videos", headers=headers, files=files ) response.raise_for_status() return response.json()
- Pydantic input schema defining the 'file_path' parameter for the upload tool.class UploadVideo(BaseModel): file_path: str = Field(description="Path to video file")
- src/zapcap_mcp_server/server.py:55-55 (registration)Tool registration via FastMCP decorator, which registers the function as an MCP tool.@mcp.tool(description="Upload video file to ZapCap")
- Helper function to retrieve the ZapCap API key from environment variable, used in the upload handler.def get_api_key() -> str: api_key = os.getenv("ZAPCAP_API_KEY") if not api_key: raise ValueError("ZAPCAP_API_KEY environment variable is required") return api_key