Skip to main content
Glama

list_attachment_assets

Find files attached to videos, such as PDFs, slides, or documents, by providing the video ID to retrieve a list of supplementary materials with names, types, and sizes.

Instructions

Find FILES ATTACHED to videos. USE WHEN: Looking for supplementary materials, PDFs, slides, documents linked to video. RETURNS: List of attached files with names, types, sizes, IDs. EXAMPLES: 'What documents are attached to training video?', 'Find PDF slides for presentation'. Attachments are additional files uploaded with videos.

Input Schema

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

Implementation Reference

  • The core handler function that lists all attachment assets for a given Kaltura media entry ID using the Attachment plugin API. Handles validation, plugin availability, filtering, and serialization of results.
    async def list_attachment_assets(
        manager: KalturaClientManager,
        entry_id: str,
    ) -> str:
        """List all attachment assets for a media entry."""
        if not validate_entry_id(entry_id):
            return json.dumps({"error": "Invalid entry ID format"}, indent=2)
    
        if not ATTACHMENT_AVAILABLE:
            return json.dumps(
                {
                    "error": "Attachment functionality is not available. The Attachment plugin is not installed.",
                    "entryId": entry_id,
                },
                indent=2,
            )
    
        client = manager.get_client()
    
        try:
            # Create filter for attachment assets
            filter = KalturaAttachmentAssetFilter()
            filter.entryIdEqual = entry_id
    
            # List attachment assets
            result = client.attachment.attachmentAsset.list(filter)
    
            attachments = []
            for attachment in result.objects:
                attachment_data = {
                    "id": attachment.id,
                    "entryId": attachment.entryId,
                    "filename": attachment.filename,
                    "title": attachment.title,
                    "format": attachment.format.value
                    if hasattr(attachment.format, "value")
                    else str(attachment.format),
                    "status": attachment.status.value
                    if hasattr(attachment.status, "value")
                    else str(attachment.status),
                    "fileExt": attachment.fileExt,
                    "size": attachment.size,
                    "createdAt": datetime.fromtimestamp(attachment.createdAt).isoformat()
                    if attachment.createdAt
                    else None,
                    "updatedAt": datetime.fromtimestamp(attachment.updatedAt).isoformat()
                    if attachment.updatedAt
                    else None,
                    "description": attachment.description,
                    "tags": attachment.tags,
                }
                attachments.append(attachment_data)
    
            return json.dumps(
                {
                    "entryId": entry_id,
                    "totalCount": result.totalCount,
                    "attachmentAssets": attachments,
                },
                indent=2,
            )
    
        except Exception as e:
            return json.dumps(
                {
                    "error": f"Failed to list attachment assets: {str(e)}",
                    "entryId": entry_id,
                },
                indent=2,
            )
  • MCP tool schema definition including input schema requiring 'entry_id' parameter.
    types.Tool(
        name="list_attachment_assets",
        description="Find FILES ATTACHED to videos. USE WHEN: Looking for supplementary materials, PDFs, slides, documents linked to video. RETURNS: List of attached files with names, types, sizes, IDs. EXAMPLES: 'What documents are attached to training video?', 'Find PDF slides for presentation'. Attachments are additional files uploaded with videos.",
        inputSchema={
            "type": "object",
            "properties": {
                "entry_id": {
                    "type": "string",
                    "description": "Video to check for attachments (format: '1_abc123')",
                },
            },
            "required": ["entry_id"],
        },
    ),
  • Registers the tool handler dispatch in the MCP server's call_tool method.
    elif name == "list_attachment_assets":
        result = await list_attachment_assets(kaltura_manager, **arguments)
  • Imports the list_attachment_assets function into the tools module namespace.
    from .assets import (
        get_attachment_content,
        get_caption_content,
        list_attachment_assets,
        list_caption_assets,
    )
  • Imports the tool function into the server module for use in list_tools and call_tool.
    list_attachment_assets,

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