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
| Name | Required | Description | Default |
|---|---|---|---|
| entry_id | Yes | Video to check for attachments (format: '1_abc123') |
Implementation Reference
- src/kaltura_mcp/tools/assets.py:191-260 (handler)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, )
- src/kaltura_mcp/server.py:462-475 (schema)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"], }, ),
- src/kaltura_mcp/server.py:525-526 (registration)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)
- src/kaltura_mcp/tools/__init__.py:13-18 (registration)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, )
- src/kaltura_mcp/server.py:45-45 (registration)Imports the tool function into the server module for use in list_tools and call_tool.list_attachment_assets,