Skip to main content
Glama

list_caption_assets

Check if a video has captions or subtitles and list available languages and formats to prepare for accessibility or transcript use.

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

TableJSON Schema
NameRequiredDescriptionDefault
entry_idYesVideo to check for captions (format: '1_abc123')

Implementation Reference

  • The main handler function that executes the list_caption_assets tool logic, querying the Kaltura API for caption assets associated with a media entry ID.
    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})
  • MCP tool schema definition including input schema (entry_id required) and usage description.
    types.Tool(
        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"],
        },
    ),
  • Tool handler registration and dispatch in the MCP server's call_tool method.
    elif name == "list_caption_assets":
        result = await list_caption_assets(kaltura_manager, **arguments)
  • Import and export of the list_caption_assets function in the tools module for use across the package.
    from .assets import (
        get_attachment_content,
        get_caption_content,
        list_attachment_assets,
        list_caption_assets,
    )
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool does (lists caption files with languages, formats, IDs), its purpose (checking availability, finding languages), and its role in a workflow (first step before getting content). However, it doesn't mention potential limitations like pagination, error conditions, or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with clear sections (purpose, usage guidelines, returns, examples, workflow positioning). Every sentence adds value: the first states the core function, the second provides usage contexts, the third specifies returns, and the fourth gives examples and workflow role. No wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no output schema, the description provides excellent context: clear purpose, usage guidelines, return information, examples, and workflow positioning. The only minor gap is the lack of explicit mention of what happens when no captions exist or error scenarios, but overall it's highly complete for this tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'entry_id' fully documented in the schema as 'Video to check for captions (format: '1_abc123')'. The description doesn't add any additional parameter semantics beyond what's already in the schema, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Find all CAPTIONS/SUBTITLES for a video') and resource ('video'), distinguishing it from sibling tools like get_caption_content (which retrieves actual content) and list_attachment_assets (which lists different asset types). It explicitly identifies what it returns, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage scenarios with 'USE WHEN: Checking if video has captions, finding available languages, preparing for accessibility, getting transcript' and positions it as 'First step before getting caption content', clearly indicating when to use this tool versus alternatives like get_caption_content. This gives comprehensive guidance on appropriate contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zoharbabin/kaltura-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server