Skip to main content
Glama
bintocher

Qlik Sense MCP Server

get_app_script

Retrieve load script content from Qlik Sense applications using the application ID to access data transformation logic.

Instructions

Get load script from app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYesApplication ID

Implementation Reference

  • Registration of the 'get_app_script' tool in the MCP list_tools handler, including name, description, and input schema requiring 'app_id'.
    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"]}),
  • MCP tool handler for 'get_app_script': validates input, connects to Qlik Engine, opens app safely, retrieves script via engine_api.get_script, handles errors, and returns JSON response.
    elif name == "get_app_script":
        app_id = arguments["app_id"]
    
        def _get_script():
            app_handle = -1
            try:
                self.engine_api.connect()
                app_result = self.engine_api.open_doc_safe(app_id, no_data=True)
                if "qReturn" not in app_result:
                    raise Exception(f"Failed to open app: invalid response {app_result}")
                app_handle = app_result["qReturn"].get("qHandle", -1)
                if app_handle == -1:
                    raise Exception(f"Failed to get app handle: {app_result}")
                script = self.engine_api.get_script(app_handle)
                return {
                    "qScript": script,
                    "app_id": app_id,
                    "app_handle": app_handle,
                    "script_length": len(script) if script else 0
                }
            except Exception as e:
                error_msg = str(e)
                if "already open" in error_msg.lower():
                    error_msg = f"App {app_id} is already open in another session. Try again later or use a different session."
                elif "failed to open app" in error_msg.lower():
                    error_msg = f"Could not open app {app_id}. Check if app exists and you have access."
                return {
                    "error": error_msg,
                    "app_id": app_id,
                    "app_handle": app_handle
                }
            finally:
                if app_handle != -1:
                    try:
                        self.engine_api.close_doc(app_handle)
                    except:
                        pass
                self.engine_api.disconnect()
    
        script = await asyncio.to_thread(_get_script)
        return [
            TextContent(
                type="text",
                text=json.dumps(script, indent=2, ensure_ascii=False)
            )
        ]
  • Core implementation of script retrieval: sends 'GetScript' JSON-RPC request to Qlik Sense Engine API via WebSocket and extracts qScript from response.
    def get_script(self, app_handle: int) -> str:
        """Get load script."""
        result = self.send_request("GetScript", [], handle=app_handle)
        return result.get("qScript", "")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get load script from app', which implies a read-only operation, but doesn't clarify permissions, rate limits, error conditions, or what the output looks like (e.g., script format, size limits). For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is extremely concise at four words, with zero wasted language. It's front-loaded with the core action ('Get load script from app'), making it easy to parse quickly. Every word earns its place by conveying the essential purpose.

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?

Given the tool's complexity (a read operation with one parameter) and lack of annotations or output schema, the description is incomplete. It doesn't explain what a 'load script' is, how it's returned, or any behavioral traits like error handling. For a tool that likely retrieves code or configuration data, more context is needed to use it effectively.

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?

The input schema has 100% description coverage, with 'app_id' documented as 'Application ID'. The description adds no additional meaning beyond this, as it doesn't explain what an 'app_id' is or provide context like valid formats. With high 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.

Purpose3/5

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

The description 'Get load script from app' states a clear verb ('Get') and resource ('load script from app'), but it's vague about what a 'load script' is and doesn't distinguish this tool from its siblings like 'get_app_details' or 'get_app_object'. It provides a basic purpose but lacks specificity about the script's nature or format.

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 offers no guidance on when to use this tool versus alternatives. With siblings like 'get_app_details' and 'get_app_object', there's no indication of when to retrieve a load script specifically, nor any prerequisites or exclusions mentioned. Usage is implied by the name alone.

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