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,
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 and does well by stating it 'RETURNS: List of attached files with names, types, sizes, IDs', disclosing output format. It adds context that 'Attachments are additional files uploaded with videos', clarifying what attachments are. However, it doesn't mention potential limitations like empty results or error conditions.

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, returns, examples, clarification), uses bullet-like formatting without waste, and is front-loaded with the core action. Every sentence adds value, such as the examples that reinforce usage context.

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 simple read-only tool with 1 parameter (100% schema coverage) and no output schema, the description is nearly complete: it covers purpose, usage, returns, and examples. It lacks details on output structure (e.g., pagination) or error handling, but given the low complexity, this is a minor gap.

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?

Schema description coverage is 100% (the entry_id parameter is fully described in the schema as 'Video to check for attachments (format: '1_abc123')'), so the baseline is 3. The description doesn't add any parameter-specific information beyond what the schema provides, but it doesn't need to compensate for gaps.

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 FILES ATTACHED to videos') and resource ('videos'), distinguishing it from sibling tools like get_attachment_content (which retrieves content) or get_media_entry (which gets video metadata). It explicitly mentions 'supplementary materials, PDFs, slides, documents' to clarify scope.

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 explicitly states 'USE WHEN: Looking for supplementary materials, PDFs, slides, documents linked to video' and provides examples like 'What documents are attached to training video?', giving clear context for when to use this tool versus alternatives like get_attachment_content (for file content) or search_entries (for broader video searches).

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