Skip to main content
Glama

get_media_entry

Retrieve complete metadata for a specific video or media file using its entry ID. Get full details including title, description, duration, tags, thumbnail, and status.

Instructions

Get complete metadata for a single video/media file. USE WHEN: You have a specific entry_id and need full details (title, description, duration, tags, thumbnail, status). RETURNS: Complete media metadata including URLs, dimensions, creation date. EXAMPLE: After search finds entry_id='1_abc123', use this to get full video details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entry_idYesThe media entry ID (format: '1_abc123' or '0_xyz789')

Implementation Reference

  • Main handler function that executes the tool: validates entry ID, retrieves the media entry via KalturaClient, handles errors, and returns formatted JSON with comprehensive metadata.
    async def get_media_entry(manager: KalturaClientManager, entry_id: str) -> str:
        """Get detailed information about a specific media entry."""
        if not validate_entry_id(entry_id):
            return json.dumps({"error": "Invalid entry ID format"}, indent=2)
    
        try:
            client = manager.get_client()
            entry: KalturaMediaEntry = client.media.get(entry_id)
        except Exception as e:
            return handle_kaltura_error(e, "get media entry", {"entry_id": entry_id})
    
        return json.dumps(
            {
                "id": entry.id,
                "name": entry.name,
                "description": entry.description,
                "mediaType": safe_serialize_kaltura_field(entry.mediaType),
                "createdAt": datetime.fromtimestamp(entry.createdAt).isoformat()
                if entry.createdAt
                else None,
                "updatedAt": datetime.fromtimestamp(entry.updatedAt).isoformat()
                if entry.updatedAt
                else None,
                "duration": entry.duration,
                "tags": entry.tags,
                "categories": entry.categories,
                "categoriesIds": entry.categoriesIds,
                "thumbnailUrl": entry.thumbnailUrl,
                "downloadUrl": entry.downloadUrl,
                "plays": entry.plays,
                "views": entry.views,
                "lastPlayedAt": datetime.fromtimestamp(entry.lastPlayedAt).isoformat()
                if entry.lastPlayedAt
                else None,
                "width": entry.width,
                "height": entry.height,
                "dataUrl": entry.dataUrl,
                "flavorParamsIds": entry.flavorParamsIds,
                "status": safe_serialize_kaltura_field(entry.status),
            },
            indent=2,
        )
  • Tool registration in MCP server's list_tools(): defines name, detailed usage description, input schema requiring 'entry_id', enabling the tool for LLM calls.
    types.Tool(
        name="get_media_entry",
        description="Get complete metadata for a single video/media file. USE WHEN: You have a specific entry_id and need full details (title, description, duration, tags, thumbnail, status). RETURNS: Complete media metadata including URLs, dimensions, creation date. EXAMPLE: After search finds entry_id='1_abc123', use this to get full video details.",
        inputSchema={
            "type": "object",
            "properties": {
                "entry_id": {
                    "type": "string",
                    "description": "The media entry ID (format: '1_abc123' or '0_xyz789')",
                },
            },
            "required": ["entry_id"],
        },
    ),
  • JSON schema defining tool input: object with required 'entry_id' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "entry_id": {
                "type": "string",
                "description": "The media entry ID (format: '1_abc123' or '0_xyz789')",
            },
        },
        "required": ["entry_id"],
    },
  • Imports the get_media_entry handler from media.py module, making it available for import from tools package.
    from .media import (
        get_download_url,
        get_media_entry,
        get_thumbnail_url,
        list_media_entries,
    )
  • Adds get_media_entry to __all__ for easy import via from tools import get_media_entry.
    "get_media_entry",

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