get_app_details
Retrieve detailed Qlik Sense application information including metadata, tables, fields, master items, and objects using GUID or name search to support analysis and management tasks.
Instructions
Get compact application info with filters by guid or name (case-insensitive). Returns metainfo, tables/fields list, master items, sheets and objects with used fields.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | No | Application GUID (preferred if known) | |
| name | No | Case-insensitive fuzzy search by app name |
Implementation Reference
- qlik_sense_mcp_server/server.py:468-544 (handler)Core handler function that executes the 'get_app_details' tool logic: resolves app identifier, authenticates via ticket, fetches and filters metadata from Proxy API, constructs response with metainfo, fields, and tables.elif name == "get_app_details": req_app_id = arguments.get("app_id") req_name = arguments.get("name") def _resolve_app() -> Dict[str, Any]: """Resolve application by ID or name from Repository API.""" try: if req_app_id: app_meta = self.repository_api.get_app_by_id(req_app_id) if isinstance(app_meta, dict) and app_meta.get("id"): return { "app_id": app_meta.get("id"), "name": app_meta.get("name", ""), "description": app_meta.get("description") or "", "stream": (app_meta.get("stream", {}) or {}).get("name", "") if app_meta.get("published") else "", "modified_dttm": app_meta.get("modifiedDate", "") or "", "reload_dttm": app_meta.get("lastReloadTime", "") or "" } return {"error": "App not found by provided app_id"} if req_name: apps_payload = self.repository_api.get_comprehensive_apps(limit=50, offset=0, name=req_name, stream=None, published=None) apps = apps_payload.get("apps", []) if isinstance(apps_payload, dict) else [] if not apps: return {"error": "No apps found by name"} lowered = req_name.lower() exact = [a for a in apps if a.get("name", "").lower() == lowered] selected = exact[0] if exact else apps[0] selected["app_id"] = selected.pop("guid", "") return selected return {"error": "Either app_id or name must be provided"} except Exception as e: return {"error": str(e)} def _get_app_details(): """Get application details with metadata, fields and tables.""" try: # Get app metadata from Repository API resolved = _resolve_app() if "error" in resolved: return resolved app_id = resolved.get("app_id") # Get Qlik ticket for authentication ticket = self._get_qlik_ticket() if not ticket: return {"error": "Failed to obtain Qlik ticket"} # Get fields and tables metadata via Proxy API metadata = self._get_app_metadata_via_proxy(app_id, ticket) if "error" in metadata: return metadata # Build final response result = { "metainfo": { "app_id": app_id, "name": resolved.get("name", ""), "description": resolved.get("description", ""), "stream": resolved.get("stream", ""), "modified_dttm": resolved.get("modified_dttm", ""), "reload_dttm": resolved.get("reload_dttm", "") }, "fields": metadata.get("fields", []), "tables": metadata.get("tables", []) } return result except Exception as e: return {"error": str(e)} details = await asyncio.to_thread(_get_app_details) return [ TextContent(type="text", text=json.dumps(details, indent=2, ensure_ascii=False)) ]
- Input schema for 'get_app_details' tool defining parameters app_id (GUID) or name (fuzzy search), with oneOf validation requiring exactly one.Tool( name="get_app_details", description="Get compact application info with filters by guid or name (case-insensitive). Returns metainfo, tables/fields list, master items, sheets and objects with used fields.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID (preferred if known)"}, "name": {"type": "string", "description": "Case-insensitive fuzzy search by app name"} }, "oneOf": [ {"required": ["app_id"]}, {"required": ["name"]} ] } ),
- qlik_sense_mcp_server/server.py:218-397 (registration)Tool registration in the list_tools handler where 'get_app_details' is defined and returned as part of the server's tool list.@self.server.list_tools() async def handle_list_tools(): """ List all available MCP tools for Qlik Sense operations. Returns tool definitions with schemas for Repository API and Engine API operations including applications, analytics tools, and data export. """ tools_list = [ Tool( name="get_apps", description="Get list of Qlik Sense applications with essential fields and filters (name, stream, published) and pagination.", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Maximum number of apps to return (default: 25, max: 50)", "default": 25 }, "offset": { "type": "integer", "description": "Number of apps to skip for pagination (default: 0)", "default": 0 }, "name": { "type": "string", "description": "Wildcard case-insensitive search in application name" }, "stream": { "type": "string", "description": "Wildcard case-insensitive search in stream name" }, "published": { "type": "string", "description": "Filter by published status (true/false or 1/0). Default: true", "default": "true" } } } ), Tool( name="get_app_details", description="Get compact application info with filters by guid or name (case-insensitive). Returns metainfo, tables/fields list, master items, sheets and objects with used fields.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID (preferred if known)"}, "name": {"type": "string", "description": "Case-insensitive fuzzy search by app name"} }, "oneOf": [ {"required": ["app_id"]}, {"required": ["name"]} ] } ), Tool(name="get_app_script", description="Get load script from app", inputSchema={"type": "object", "properties": {"app_id": {"type": "string", "description": "Application ID"}}, "required": ["app_id"]}), Tool(name="get_app_field_statistics", description="Get comprehensive statistics for a field", inputSchema={"type": "object", "properties": {"app_id": {"type": "string", "description": "Application ID"}, "field_name": {"type": "string", "description": "Field name"}}, "required": ["app_id", "field_name"]}), Tool(name="engine_create_hypercube", description="Create hypercube for data analysis with custom sorting options. IMPORTANT: To get top-N records, use qSortByExpression: 1 in dimension sorting with qExpression containing the measure formula (e.g., 'Count(field)' for ascending, '-Count(field)' for descending). Measure sorting is ignored by Qlik Engine.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application ID"}, "dimensions": { "type": "array", "items": { "type": "object", "properties": { "field": {"type": "string", "description": "Field name for dimension"}, "label": {"type": "string", "description": "Optional label for dimension"}, "sort_by": { "type": "object", "properties": { "qSortByNumeric": {"type": "integer", "description": "Sort by numeric value (-1 desc, 0 none, 1 asc)", "default": 0}, "qSortByAscii": {"type": "integer", "description": "Sort by ASCII value (-1 desc, 0 none, 1 asc)", "default": 1}, "qSortByExpression": {"type": "integer", "description": "Use expression for sorting (0/1). For top-N results, set to 1 and use qExpression with measure formula", "default": 0}, "qExpression": {"type": "string", "description": "Expression for custom sorting. For top-N: 'Count(field)' for ascending, '-Count(field)' for descending", "default": ""} }, "additionalProperties": False } }, "additionalProperties": False }, "description": "List of dimension definitions with optional sorting" }, "measures": { "type": "array", "items": { "type": "object", "properties": { "expression": {"type": "string", "description": "Measure expression"}, "label": {"type": "string", "description": "Optional label for measure"}, "sort_by": { "type": "object", "properties": { "qSortByNumeric": {"type": "integer", "description": "Sort by numeric value (-1 desc, 0 none, 1 asc). NOTE: Measure sorting is ignored by Qlik Engine - use dimension sorting with qSortByExpression for top-N results", "default": -1} }, "additionalProperties": False } }, "additionalProperties": False }, "description": "List of measure definitions with optional sorting" }, "max_rows": {"type": "integer", "description": "Maximum rows to return", "default": 1000} }, "required": ["app_id"] }) , Tool( name="get_app_field", description="Return values of a single field from app with pagination and wildcard search (supports * and %).", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID"}, "field_name": {"type": "string", "description": "Field name"}, "limit": {"type": "integer", "description": "Max values to return (default: 10, max: 100)", "default": 10}, "offset": {"type": "integer", "description": "Offset for pagination (default: 0)", "default": 0}, "search_string": {"type": "string", "description": "Wildcard text search mask (* and % supported), case-insensitive by default"}, "search_number": {"type": "string", "description": "Wildcard numeric search mask (* and % supported)"}, "case_sensitive": {"type": "boolean", "description": "Case sensitive matching for search_string", "default": False} }, "required": ["app_id", "field_name"], } ), Tool( name="get_app_variables", description="Return variables split by source (script/ui) with pagination and wildcard search.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID"}, "limit": {"type": "integer", "description": "Max variables to return (default: 10, max: 100)", "default": 10}, "offset": {"type": "integer", "description": "Offset for pagination (default: 0)", "default": 0}, "created_in_script": {"type": "string", "description": "Return only variables created in script (true/false). If omitted, return both"}, "search_string": {"type": "string", "description": "Wildcard search by variable name or text value (* and % supported), case-insensitive by default"}, "search_number": {"type": "string", "description": "Wildcard search among numeric variable values (* and % supported)"}, "case_sensitive": {"type": "boolean", "description": "Case sensitive matching for search_string", "default": False} }, "required": ["app_id"], } ), Tool( name="get_app_sheets", description="Get list of sheets from application with title and description.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID"} }, "required": ["app_id"] } ), Tool( name="get_app_sheet_objects", description="Get list of objects from specific sheet with object ID, type and description.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID"}, "sheet_id": {"type": "string", "description": "Sheet GUID"} }, "required": ["app_id", "sheet_id"] } ), Tool( name="get_app_object", description="Get specific object layout by calling GetObject and GetLayout sequentially via WebSocket.", inputSchema={ "type": "object", "properties": { "app_id": {"type": "string", "description": "Application GUID"}, "object_id": {"type": "string", "description": "Object ID to retrieve"} }, "required": ["app_id", "object_id"] } ) ] return tools_list
- Helper function to filter app metadata, removing system/reserved/hidden fields and renaming cardinal to unique_count, used in get_app_details response preparation.def _filter_metadata(self, metadata: Dict[str, Any]) -> Dict[str, Any]: """Filter metadata to remove system fields and hidden items.""" # Fields to remove from output fields_to_remove = { 'is_system', 'is_hidden', 'is_semantic', 'distinct_only', 'is_locked', 'always_one_selected', 'is_numeric', 'hash', 'tags', 'has_section_access', 'tables_profiling_data', 'is_direct_query_mode', 'usage', 'reload_meta', 'static_byte_size', 'byte_size', 'no_of_key_fields' } # Qlik Sense reserved fields to remove qlik_reserved_fields = {'$Field', '$Table', '$Rows', '$Fields', '$FieldNo', '$Info'} def filter_object(obj): """Recursively filter object.""" if isinstance(obj, dict): filtered = {} for key, value in obj.items(): # Skip fields to remove if key in fields_to_remove: continue # Skip fields with is_system: true or is_hidden: true if isinstance(value, dict): if value.get('is_system') or value.get('is_hidden'): continue # Replace cardinal with unique_count if key == 'cardinal': filtered['unique_count'] = value continue # Recursively filter nested objects filtered[key] = filter_object(value) return filtered elif isinstance(obj, list): # Filter field arrays, removing reserved Qlik fields if obj and isinstance(obj[0], dict) and 'name' in obj[0]: # This is a fields array return [filter_object(item) for item in obj if item.get('name') not in qlik_reserved_fields] else: return [filter_object(item) for item in obj] else: return obj # Keep only fields and tables filtered = filter_object(metadata) result = {} if 'fields' in filtered: result['fields'] = filtered['fields'] if 'tables' in filtered: result['tables'] = filtered['tables'] return result
- Repository API helper method get_app_by_id used by get_app_details to fetch app metadata by GUID.def get_app_by_id(self, app_id: str) -> Dict[str, Any]: """Get specific app by ID.""" return self._make_request("GET", f"app/{app_id}")