Skip to main content
Glama

get_notebook_driver_logs

Retrieve Spark driver logs from completed notebook executions to debug Python errors and analyze Spark behavior. Use stdout for Python tracebacks or stderr for system logs.

Instructions

Get Spark driver logs for a notebook execution.

Retrieves the driver logs (stdout or stderr) from a completed notebook run. This is particularly useful for getting detailed error messages and Python tracebacks when a notebook fails.

Important Notes:

  • Python exceptions and tracebacks appear in stdout, not stderr

  • stderr contains Spark/system logs (typically larger)

  • For failed notebooks, check stdout first for the Python error

  • Look for "Error", "Exception", "Traceback" in the output

Use this tool when:

  • A notebook execution failed and you need to see the Python error

  • You want to debug notebook issues by examining driver logs

  • You need to analyze Spark driver behavior (stderr)

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. log_type: Type of log to retrieve - "stdout" (default) or "stderr". Use "stdout" for Python errors and print statements. Use "stderr" for Spark/system logs. max_lines: Maximum number of lines to return (default: 500, None for all). Returns the last N lines (most recent, where errors typically are).

Returns: Dictionary with: - status: "success" or "error" - message: Description of the result - log_type: Type of log retrieved - log_content: The actual log content as a string - log_size_bytes: Total size of the log file - truncated: Whether the log was truncated - spark_application_id: The Spark application ID - livy_id: The Livy session ID

Example: ```python # Get Python error from a failed notebook result = get_notebook_driver_logs( workspace_name="Analytics", notebook_name="ETL_Pipeline", job_instance_id="12345678-1234-1234-1234-123456789abc", log_type="stdout" # Python errors are in stdout! )

if result["status"] == "success": print(result["log_content"]) # Output will include Python traceback like: # ZeroDivisionError: division by zero # Traceback (most recent call last): # Cell In[11], line 2 # result = x / 0 ```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_nameYes
notebook_nameYes
job_instance_idYes
log_typeNostdout
max_linesNo

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