list_categories
Explore and organize content hierarchies by retrieving category IDs, names, and parent-child relationships. Use to filter videos, understand taxonomy, and manage content structure efficiently.
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 |
|---|---|---|---|
| limit | No | Maximum number of categories to return (default: 20) | |
| search_text | No | Optional text to filter categories (e.g., 'training', 'marketing') |
Implementation Reference
- src/kaltura_mcp/tools/search.py:39-82 (handler)The main handler function that implements the list_categories tool. It queries Kaltura categories using filter and pager, formats the results as JSON.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:88-102 (registration)Registers the list_categories tool with the MCP server in list_tools(), including input schema definition and detailed description.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/remote_server.py:475-489 (registration)Registers the list_categories tool in the remote MCP server get_available_tools(), with input schema.name="list_categories", description="List and search content categories", inputSchema={ "type": "object", "properties": { "search_text": { "type": "string", "description": "Filter categories by name or description", }, "limit": { "type": "integer", "description": "Maximum number of categories to return (default: 20)", }, }, },
- src/kaltura_mcp/server.py:499-500 (handler)Tool dispatch in server.call_tool() that invokes the list_categories handler.elif name == "list_categories": result = await list_categories(kaltura_manager, **arguments)
- src/kaltura_mcp/remote_server.py:555-556 (handler)Tool dispatch in remote_server call_tool that invokes the list_categories handler.elif tool_name == "list_categories": result = await list_categories(kaltura_manager, **arguments)