Skip to main content
Glama

list_categories

Browse and explore content organization hierarchy to find category IDs for filtering and understand content taxonomy in Kaltura's media management system.

Instructions

Browse content organization hierarchy. USE WHEN: Exploring content structure, finding category IDs for filtering, understanding content taxonomy. Categories organize videos into folders/topics. RETURNS: Tree structure with category names, IDs, parent-child relationships. EXAMPLE: Find all videos in 'Training' category by first getting category ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_textNoOptional text to filter categories (e.g., 'training', 'marketing')
limitNoMaximum number of categories to return (default: 20)

Implementation Reference

  • The core handler function that executes the list_categories tool: filters categories by optional search text, paginates results, extracts key metadata, and returns formatted JSON response.
    async def list_categories(
        manager: KalturaClientManager,
        search_text: Optional[str] = None,
        limit: int = 20,
    ) -> str:
        """List available categories."""
        client = manager.get_client()
    
        # Create filter
        filter = KalturaCategoryFilter()
        if search_text:
            filter.freeText = search_text
    
        # Create pager
        pager = KalturaFilterPager()
        pager.pageSize = limit
    
        # List categories
        result = client.category.list(filter, pager)
    
        categories = []
        for category in result.objects:
            categories.append(
                {
                    "id": category.id,
                    "name": category.name,
                    "description": category.description,
                    "tags": category.tags,
                    "fullName": category.fullName,
                    "depth": category.depth,
                    "entriesCount": category.entriesCount,
                    "createdAt": datetime.fromtimestamp(category.createdAt).isoformat()
                    if category.createdAt
                    else None,
                }
            )
    
        return json.dumps(
            {
                "totalCount": result.totalCount,
                "categories": categories,
            },
            indent=2,
        )
  • MCP tool schema definition including input validation for search_text and limit parameters, with detailed usage description.
    types.Tool(
        name="list_categories",
        description="Browse content organization hierarchy. USE WHEN: Exploring content structure, finding category IDs for filtering, understanding content taxonomy. Categories organize videos into folders/topics. RETURNS: Tree structure with category names, IDs, parent-child relationships. EXAMPLE: Find all videos in 'Training' category by first getting category ID.",
        inputSchema={
            "type": "object",
            "properties": {
                "search_text": {
                    "type": "string",
                    "description": "Optional text to filter categories (e.g., 'training', 'marketing')",
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of categories to return (default: 20)",
                },
            },
        },
    ),
  • Tool dispatch registration in the MCP server's call_tool handler, invoking the list_categories function with Kaltura manager and arguments.
    elif name == "list_categories":
        result = await list_categories(kaltura_manager, **arguments)
  • Package-level import registration exposing list_categories from the search module to the tools namespace.
        esearch_entries,
        list_categories,
        search_entries,
        search_entries_intelligent,
    )

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