Skip to main content
Glama

Get Notebook Execution Details

get_notebook_execution_details

Retrieve execution metadata for notebook runs, including timing, resource usage, and execution state, to monitor performance and verify resource allocation.

Instructions

Get detailed execution information for a notebook run by job instance ID.

Retrieves execution metadata from the Fabric Notebook Livy Sessions API, which provides detailed timing, resource usage, and execution state information.

Use this tool when:

  • You want to check the status and timing of a completed notebook run

  • You need to verify resource allocation for a notebook execution

  • You want to analyze execution performance (queue time, run time)

Note: This method returns execution metadata (timing, state, resource usage). Cell-level outputs are only available for active sessions. Once a notebook job completes, individual cell outputs cannot be retrieved via the REST API. To capture cell outputs, use mssparkutils.notebook.exit() in your notebook and access the exitValue through Data Pipeline activities.

Parameters: workspace_name: The display name of the workspace containing the notebook. notebook_name: Name of the notebook. job_instance_id: The job instance ID from execute_notebook or run_on_demand_job result.

Returns: Dictionary with: - status: "success" or "error" - message: Description of the result - session: Full Livy session details (state, timing, resources) - execution_summary: Summarized execution information including: - state: Execution state (Success, Failed, Cancelled, etc.) - spark_application_id: Spark application identifier - queued_duration_seconds: Time spent in queue - running_duration_seconds: Actual execution time - total_duration_seconds: Total end-to-end time - driver_memory, driver_cores, executor_memory, etc.

Example: ```python # After executing a notebook exec_result = run_on_demand_job( workspace_name="Analytics", item_name="ETL_Pipeline", item_type="Notebook", job_type="RunNotebook" )

# Get detailed execution information
details = get_notebook_execution_details(
    workspace_name="Analytics",
    notebook_name="ETL_Pipeline",
    job_instance_id=exec_result["job_instance_id"]
)

if details["status"] == "success":
    summary = details["execution_summary"]
    print(f"State: {summary['state']}")
    print(f"Duration: {summary['total_duration_seconds']}s")
    print(f"Spark App ID: {summary['spark_application_id']}")
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_nameYes
notebook_nameYes
job_instance_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 retrieves metadata from the Fabric Notebook Livy Sessions API, provides timing/resource usage/state information, and clarifies limitations about cell-level outputs. It doesn't mention error handling, rate limits, or authentication requirements, but covers the core behavioral aspects well.

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 with clear sections (purpose, usage guidelines, notes, parameters, returns, example). Every sentence adds value: the opening explains what the tool does, the usage guidelines provide context, the note clarifies limitations, and the parameters/returns sections document essential information. The example is relevant and demonstrates practical usage.

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 (execution details retrieval), no annotations, and an output schema present, the description provides excellent completeness. It explains the tool's purpose, when to use it, behavioral characteristics, parameter meanings, and includes a comprehensive example. The output schema handles return value documentation, so the description appropriately focuses on usage context.

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?

Schema description coverage is 0%, so the description must fully compensate. It provides clear semantic explanations for all three parameters: 'workspace_name' as 'display name of the workspace containing the notebook', 'notebook_name' as 'Name of the notebook', and 'job_instance_id' as 'The job instance ID from execute_notebook or run_on_demand_job result'. This adds significant value 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 tool's purpose with specific verbs ('Get detailed execution information', 'Retrieves execution metadata') and identifies the resource ('notebook run by job instance ID'). It distinguishes from siblings like 'get_notebook_content' or 'get_job_status' by focusing on execution metadata rather than content or generic job status.

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 explicitly provides usage guidelines with a dedicated 'Use this tool when:' section listing three specific scenarios (check status/timing, verify resource allocation, analyze performance). It also includes a 'Note:' section explaining limitations (cell outputs not available for completed sessions) and alternatives (using mssparkutils.notebook.exit() for cell outputs).

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