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
| Name | Required | Description | Default |
|---|---|---|---|
| search_text | No | Optional text to filter categories (e.g., 'training', 'marketing') | |
| limit | No | Maximum number of categories to return (default: 20) |
Implementation Reference
- src/kaltura_mcp/tools/search.py:39-82 (handler)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, )
- src/kaltura_mcp/server.py:87-103 (schema)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)", }, }, }, ),
- src/kaltura_mcp/server.py:499-500 (registration)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)
- src/kaltura_mcp/tools/__init__.py:28-32 (registration)Package-level import registration exposing list_categories from the search module to the tools namespace.esearch_entries, list_categories, search_entries, search_entries_intelligent, )