Skip to main content
Glama
bintocher

Qlik Sense MCP Server

get_app_sheets

Retrieve sheet titles and descriptions from Qlik Sense applications to analyze dashboard structure and content organization.

Instructions

Get list of sheets from application with title and description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYesApplication GUID

Implementation Reference

  • Core handler function that implements get_app_sheets logic by creating a SheetList session object in Qlik Engine API, retrieving its layout, and extracting sheet information including ID, title, and description.
    def get_sheets(self, app_handle: int) -> List[Dict[str, Any]]:
        """Get app sheets."""
        try:
            sheet_list_def = {
                "qInfo": {"qType": "SheetList"},
                "qAppObjectListDef": {
                    "qType": "sheet",
                    "qData": {
                        "title": "/qMetaDef/title",
                        "description": "/qMetaDef/description",
                        "thumbnail": "/thumbnail",
                        "cells": "/cells",
                        "rank": "/rank",
                        "columns": "/columns",
                        "rows": "/rows"
                    }
                }
            }
    
            create_result = self.send_request("CreateSessionObject", [sheet_list_def], handle=app_handle)
    
            if "qReturn" not in create_result or "qHandle" not in create_result["qReturn"]:
                logger.warning(f"Failed to create SheetList object: {create_result}")
                return []
    
            sheet_list_handle = create_result["qReturn"]["qHandle"]
            layout_result = self.send_request("GetLayout", [], handle=sheet_list_handle)
            if "qLayout" not in layout_result or "qAppObjectList" not in layout_result["qLayout"]:
                logger.warning(f"No sheet list in layout: {layout_result}")
                return []
    
            sheets = layout_result["qLayout"]["qAppObjectList"]["qItems"]
            logger.info(f"Found {len(sheets)} sheets")
            return sheets
    
        except Exception as e:
            logger.error(f"get_sheets exception: {str(e)}")
            return []
  • MCP server tool dispatch handler for get_app_sheets: validates input, connects to Engine API, opens app, calls engine_api.get_sheets, formats response with sheet_id, title, description, and returns JSON.
    elif name == "get_app_sheets":
        app_id = arguments["app_id"]
    
        def _get_app_sheets():
            try:
                self.engine_api.connect()
                app_result = self.engine_api.open_doc_safe(app_id, no_data=True)
                app_handle = app_result.get("qReturn", {}).get("qHandle", -1)
                if app_handle == -1:
                    return {"error": "Failed to open app"}
    
                sheets = self.engine_api.get_sheets(app_handle)
                sheets_list = []
                for sheet in sheets:
                    sheet_info = sheet.get("qMeta", {})
                    sheet_data = sheet.get("qData", {})
                    sheets_list.append({
                        "sheet_id": sheet.get("qInfo", {}).get("qId", ""),
                        "title": sheet_info.get("title", ""),
                        "description": sheet_info.get("description", "")
                    })
    
                return {
                    "app_id": app_id,
                    "total_sheets": len(sheets_list),
                    "sheets": sheets_list
                }
            except Exception as e:
                return {"error": str(e)}
            finally:
                self.engine_api.disconnect()
    
        result = await asyncio.to_thread(_get_app_sheets)
        return [TextContent(type="text", text=json.dumps(result, indent=2, ensure_ascii=False))]
  • Tool schema definition: requires 'app_id' (Application GUID), describes purpose of retrieving sheets with titles and descriptions.
    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"]
        }
    ),
  • MCP tool registration in list_tools handler: registers get_app_sheets among other tools with its schema and description for client discovery.
    @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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get list' implies a read-only operation, it doesn't specify whether this requires authentication, what format the list returns (e.g., paginated, filtered), or any rate limits. The description is minimal and lacks important operational context for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could potentially be more front-loaded with additional context about when to use it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the returned list takes, whether it includes all sheets or is filtered, or what happens with invalid app_ids. The description should provide more operational context given the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single parameter 'app_id' fully documented as 'Application GUID'. The description doesn't add any parameter-specific information beyond what the schema provides, but with complete schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get list of sheets') and resource ('from application'), specifying what information is retrieved ('with title and description'). It distinguishes this from general app retrieval tools like 'get_apps' by focusing specifically on sheets, but doesn't explicitly differentiate from the sibling 'get_app_sheet_objects' which might retrieve different sheet-related data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer this over 'get_app_sheet_objects' or other sheet-related tools, nor does it specify prerequisites or context for usage beyond the basic parameter requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/bintocher/qlik-sense-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server