list_caption_assets
Retrieve all available captions and subtitles for a video, including languages, formats (SRT/VTT), and file IDs. Use to verify accessibility, check supported languages, or prepare for transcription processes.
Instructions
Find all CAPTIONS/SUBTITLES for a video. USE WHEN: Checking if video has captions, finding available languages, preparing for accessibility, getting transcript. RETURNS: List of caption files with languages, formats (SRT/VTT), IDs. EXAMPLE: 'Does video 1_abc123 have captions?', 'List subtitle languages available'. First step before getting caption content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry_id | Yes | Video to check for captions (format: '1_abc123') |
Implementation Reference
- src/kaltura_mcp/tools/assets.py:32-94 (handler)The core handler function that lists all caption assets for a given media entry ID using the Kaltura Caption plugin API. Validates input, fetches caption assets with filter, serializes data safely, and returns JSON with caption details including language, format, status, and timestamps.async def list_caption_assets( manager: KalturaClientManager, entry_id: str, ) -> str: """List all caption assets for a media entry.""" if not validate_entry_id(entry_id): return json.dumps({"error": "Invalid entry ID format"}, indent=2) if not CAPTION_AVAILABLE: return json.dumps( { "error": "Caption functionality is not available. The Caption plugin is not installed.", "entryId": entry_id, }, indent=2, ) client = manager.get_client() try: # Create filter for caption assets filter = KalturaCaptionAssetFilter() filter.entryIdEqual = entry_id # List caption assets result = client.caption.captionAsset.list(filter) captions = [] for caption in result.objects: caption_data = { "id": getattr(caption, "id", None), "entryId": getattr(caption, "entryId", None), "language": safe_serialize_kaltura_field(getattr(caption, "language", None)), "languageCode": safe_serialize_kaltura_field( getattr(caption, "languageCode", None) ), "label": getattr(caption, "label", None), "format": safe_serialize_kaltura_field(getattr(caption, "format", None)), "status": safe_serialize_kaltura_field(getattr(caption, "status", None)), "fileExt": getattr(caption, "fileExt", None), "size": getattr(caption, "size", None), "createdAt": datetime.fromtimestamp(caption.createdAt).isoformat() if caption.createdAt else None, "updatedAt": datetime.fromtimestamp(caption.updatedAt).isoformat() if caption.updatedAt else None, "accuracy": getattr(caption, "accuracy", None), "isDefault": safe_serialize_kaltura_field(getattr(caption, "isDefault", None)), } captions.append(caption_data) return json.dumps( { "entryId": entry_id, "totalCount": result.totalCount, "captionAssets": captions, }, indent=2, ) except Exception as e: return handle_kaltura_error(e, "list caption assets", {"entryId": entry_id})
- src/kaltura_mcp/server.py:435-447 (schema)Input schema definition for the list_caption_assets tool, specifying the required 'entry_id' parameter as a string.name="list_caption_assets", description="Find all CAPTIONS/SUBTITLES for a video. USE WHEN: Checking if video has captions, finding available languages, preparing for accessibility, getting transcript. RETURNS: List of caption files with languages, formats (SRT/VTT), IDs. EXAMPLE: 'Does video 1_abc123 have captions?', 'List subtitle languages available'. First step before getting caption content.", inputSchema={ "type": "object", "properties": { "entry_id": { "type": "string", "description": "Video to check for captions (format: '1_abc123')", }, }, "required": ["entry_id"], }, ),
- src/kaltura_mcp/server.py:521-522 (registration)Tool dispatch registration in the MCP server's call_tool handler, mapping the tool name to the list_caption_assets function execution.elif name == "list_caption_assets": result = await list_caption_assets(kaltura_manager, **arguments)
- src/kaltura_mcp/tools/__init__.py:17-17 (registration)Export of list_caption_assets function in the tools package __init__.py for easy import.list_caption_assets,