---
title: "Analyze a notebook deterministically, without the LLM"
method: POST
path: "/cases/analyze_notebook"
tags: ["cases"]
---

# Analyze a notebook deterministically, without the LLM

`POST /cases/analyze_notebook`

The machine-extracted structure alone: parameter candidates, the
parameter-cell verdict, capturable variables, kernelspec presence. The
upload page calls this the moment a notebook is selected — its wizard
does not advance until the parameter cell is settled, so the verdict
cannot wait for an LLM round-trip. The prose suggestion endpoints run
separately, once the cell is settled.

## Request body

- object
  - `notebook` object, required — The uploaded notebook JSON object.

## Response `200`

Notebook analyzed

- object
  - `analysis` object, required
    - `capturable_variables` string[], required — Top-level variables whose end-of-run values the run captures as the structured results
    - `cell_count` integer, required — Number of notebook cells (all cell types)
    - `has_kernelspec` boolean, required — Whether metadata.kernelspec names a kernel; papermill refuses to inject parameters without one, so uploads with a parameter cell require it
    - `parameter_cell_index` integer, nullable, required — Index (among all cells) of the parameter cell — the first code cell tagged "parameters", falling back to the legacy matlantis_parameter_cell metadata key — or null when none exists
    - `parameters` object[], required — The parameter cell's literal assignments, usable as form parameters; empty when the notebook has no parameter cell
      - `default_value` string, required — Assigned literal as a plain string; tuple / array keep the literal text (e.g. "(1, 1, 1)", "[423, 523]")
      - `value_type` 'number' | 'smiles' | 'string' | 'tuple' | 'array', required — Value type inferred from the assigned literal
      - `variable_name` string, required — Variable name assigned in a code cell

## Other responses

- `400` — Bad request
- `default` — Other error

---

[API](https://skmtc.dev/matlantis/apis/matlantis-web-ui-backend-api.md) · [All operations](https://skmtc.dev/matlantis/apis/matlantis-web-ui-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/matlantis/matlantis-web-ui-backend-api/revisions/b155f3a32673/schema)
