Skip to main content
Glama

Get Notebook Driver Logs

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/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 and excels at this. It explains critical behavioral details: that Python exceptions appear in stdout (not stderr), that stderr contains Spark/system logs, how max_lines works (returns last N lines), and what the return dictionary contains. This provides comprehensive context beyond basic functionality.

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, important notes, usage guidelines, parameters, returns, example) and every sentence earns its place. The information is front-loaded with the core purpose first, followed by critical behavioral details. No wasted words while maintaining excellent clarity.

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?

For a tool with 5 parameters, 0% schema coverage, no annotations, but with an output schema, the description provides exceptional completeness. It covers all parameters thoroughly, explains behavioral nuances, provides usage scenarios, documents the return structure, and includes a practical example. The output schema existence means the description doesn't need to explain return values in detail, but it still provides helpful context about what information is returned.

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 detailed semantic explanations for all 5 parameters. Each parameter gets clear guidance: workspace_name and notebook_name identify the resource, job_instance_id specifies which execution, log_type explains the stdout/stderr distinction with usage advice, and max_lines describes the truncation behavior and default.

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 ('Get Spark driver logs') and resource ('for a notebook execution'), distinguishing it from siblings like get_notebook_content or get_notebook_execution_details. It explicitly identifies the logs as driver logs from completed notebook runs, which is precise and avoids confusion with other log-related tools.

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 includes an explicit 'Use this tool when:' section that lists three specific scenarios (notebook execution failed, debugging notebook issues, analyzing Spark driver behavior). It also provides important notes on when to use stdout vs. stderr, offering clear guidance on alternatives within the tool itself.

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