Skip to main content
Glama

Get Livy Statement Status

livy_get_statement_status

Check the execution status and retrieve output of a Livy statement in Microsoft Fabric. Monitor statement progress and access results when available.

Instructions

Get the current status and output of a Livy statement.

Retrieves the status, output, and execution details of a statement. Use this for manual status checking without auto-polling.

Statement States:

  • 'waiting': Statement is queued for execution

  • 'running': Statement is currently executing

  • 'available': Statement completed successfully

  • 'error': Statement encountered an error

  • 'cancelling': Statement is being cancelled

  • 'cancelled': Statement was cancelled

Parameters: workspace_id: Fabric workspace ID. lakehouse_id: Fabric lakehouse ID. session_id: Livy session ID. statement_id: Statement ID to check.

Returns: Dictionary with statement status including id, state, output, and code. Output field contains execution results when state is 'available'.

Example: ```python result = livy_get_statement_status( workspace_id="12345678-1234-1234-1234-123456789abc", lakehouse_id="87654321-4321-4321-4321-210987654321", session_id="0", statement_id="1" )

if result.get("state") == "available":
    output = result.get("output", {})
    print(f"Status: {output.get('status')}")
    print(f"Result: {output.get('data', {}).get('text/plain')}")
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idYes
lakehouse_idYes
session_idYes
statement_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior by listing all possible statement states (waiting, running, available, error, cancelling, cancelled) and explaining what the output field contains when state is 'available'. However, it doesn't mention error handling, rate limits, or authentication needs, leaving some behavioral aspects uncovered.

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 well-structured and appropriately sized. It front-loads the core purpose, follows with usage guidelines, provides a detailed state enumeration, documents parameters, describes returns, and includes a practical example. Every section adds value without redundancy.

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

Completeness5/5

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

Given the tool's complexity (checking statement execution status), no annotations, and an output schema (which handles return values), the description is complete. It covers purpose, usage, behavioral details (states), parameters, and includes an example that demonstrates how to interpret results. No significant gaps remain for effective tool use.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing clear parameter documentation. It lists all four parameters with brief explanations (e.g., 'Fabric workspace ID', 'Statement ID to check'), adding essential semantic meaning beyond the bare schema. The example further clarifies parameter usage with concrete values.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('get', 'retrieves') and resources ('Livy statement status and output'), distinguishing it from siblings like livy_cancel_statement or livy_run_statement. It explicitly mentions retrieving status, output, and execution details, making the purpose unambiguous.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Use this for manual status checking without auto-polling.' This clearly indicates when to use this tool versus automated alternatives, and it distinguishes it from other Livy tools like livy_run_statement (which executes) or livy_cancel_statement (which cancels).

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/bablulawrence/ms-fabric-mcp-server'

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