get_app_object
Retrieve specific object layouts from Qlik Sense applications by providing application and object identifiers to access detailed analytics components.
Instructions
Get specific object layout by calling GetObject and GetLayout sequentially via WebSocket.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | Application GUID | |
| object_id | Yes | Object ID to retrieve |
Implementation Reference
- qlik_sense_mcp_server/server.py:384-396 (registration)Registration of the 'get_app_object' tool including name, description, and JSON schema for input parameters (app_id and object_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"] } ) ]
- Main handler logic for executing the 'get_app_object' tool. Connects to Engine API, opens the app, retrieves object handle with GetObject, fetches layout with GetLayout, and returns the result as JSON.elif name == "get_app_object": app_id = arguments["app_id"] object_id = arguments["object_id"] def _get_app_object(): try: self.engine_api.connect() app_result = self.engine_api.open_doc(app_id, no_data=False) app_handle = app_result.get("qReturn", {}).get("qHandle", -1) if app_handle == -1: return {"error": "Failed to open app"} # Get object obj_result = self.engine_api.send_request("GetObject", {"qId": object_id}, handle=app_handle) if "qReturn" not in obj_result: return {"error": f"Object {object_id} not found"} obj_handle = obj_result["qReturn"]["qHandle"] # Get layout layout_result = self.engine_api.send_request("GetLayout", [], handle=obj_handle) if "qLayout" not in layout_result: return {"error": "Failed to get object layout"} # Return only the result part as requested return layout_result except Exception as e: return {"error": str(e), "app_id": app_id, "object_id": object_id} finally: self.engine_api.disconnect() result = await asyncio.to_thread(_get_app_object) return [ TextContent( type="text", text=json.dumps(result, indent=2, ensure_ascii=False) ) ]
- Helper method in EngineAPI class that performs the GetObject request, used indirectly in the tool handler."""Get object by ID.""" return self.send_request("GetObject", {"qId": object_id}, handle=app_handle)