Skip to main content
Glama

Close Livy Session

livy_close_session

Terminate a Livy Spark session in Microsoft Fabric to release resources and cancel running statements. Specify workspace, lakehouse, and session IDs to close the session.

Instructions

Close (terminate) a Livy session.

Terminates the specified Livy session and releases its resources. Any running statements will be cancelled.

Parameters: workspace_id: Fabric workspace ID. lakehouse_id: Fabric lakehouse ID. session_id: Livy session ID to close.

Returns: Dictionary with success/error status and message.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idYes
lakehouse_idYes
session_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it terminates the session, releases resources, and cancels any running statements. However, it lacks details on permissions, error handling, or side effects (e.g., irreversible termination). This is adequate but leaves gaps for a destructive operation.

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 well-structured with a clear opening sentence, bullet points for parameters and returns, and an example. It is appropriately sized, though the example could be slightly trimmed. Every sentence adds value, but minor redundancy exists in the example's parameter listing.

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 complexity (destructive operation with 3 parameters), no annotations, and an output schema present, the description is fairly complete. It covers purpose, parameters, returns, and includes an example. However, it could improve by mentioning authentication needs or error scenarios, given the lack of annotations.

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?

The schema description coverage is 0%, so the description must compensate. It explicitly lists all three parameters (workspace_id, lakehouse_id, session_id) with clear semantics: workspace_id as 'Fabric workspace ID', lakehouse_id as 'Fabric lakehouse ID', and session_id as 'Livy session ID to close'. This adds essential meaning beyond the bare schema.

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 ('Close (terminate)') and resource ('a Livy session'), distinguishing it from sibling tools like livy_create_session, livy_list_sessions, and livy_get_session_status. The verb 'terminates' and the clarification about releasing resources and cancelling statements make 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 Guidelines4/5

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

The description implies usage context by specifying that it terminates a session and cancels running statements, suggesting it should be used to clean up resources. However, it does not explicitly state when to use it versus alternatives (e.g., livy_cancel_statement for specific statements) or any prerequisites, such as needing an active 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