Skip to main content
Glama

Cancel Livy Statement

livy_cancel_statement

Cancel a running Livy statement while keeping the session active for new queries. This tool stops statements in 'waiting' or 'running' state without terminating the session.

Instructions

Cancel a running Livy statement without killing the session.

Cancels a statement that is currently 'waiting' or 'running'. The statement will transition to 'cancelling' then 'cancelled' state. The session remains available for new statements.

Note: Only works on statements in 'waiting' or 'running' state.

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

Returns: Dictionary with cancellation result (typically {"msg": "canceled"}).

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

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: it cancels statements, transitions them through states ('cancelling' then 'cancelled'), and leaves the session intact. However, it doesn't mention potential side effects, error conditions, or rate limits, 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 front-loaded with the core purpose. Every sentence adds value: the first states the action, the second explains state transitions, the third notes session preservation, the fourth provides a critical usage note, and subsequent sections clearly document parameters, returns, and an example without redundancy.

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

Completeness4/5

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

Given the tool's moderate complexity (4 parameters, no annotations, but with an output schema), the description is largely complete. It covers purpose, usage, behavior, parameters, and returns. The output schema exists, so detailed return value explanation isn't needed. However, it lacks error handling or permission context, which could be useful for a cancellation tool.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It lists all four parameters with brief explanations (e.g., 'Fabric workspace ID'), adding meaningful context beyond the bare schema. However, it doesn't provide format details (e.g., UUID format) or constraints, leaving some semantic gaps.

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 specific action ('Cancel a running Livy statement') and resource ('Livy statement'), distinguishing it from sibling tools like livy_close_session (which kills the session) and livy_run_statement (which runs statements). It explicitly notes the session remains available, which differentiates it from session-terminating alternatives.

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 guidance on when to use this tool: 'Only works on statements in 'waiting' or 'running' state.' It also implicitly suggests when not to use it (for statements not in those states) and distinguishes it from livy_close_session by noting 'without killing the session.'

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