strands.vended_tools.notebook.notebook
Notebook tool for managing persistent text notebooks in agent state.
Notebooks are stored on the agent’s :attr:~strands.Agent.state under the
notebooks key and persist within the agent session.
The tool is a thin wrapper over agent.state — persistence, isolation, and
serialization all follow whatever the caller configured for agent state.
Supported operations: create, list, read, write (append,
string replacement, or line insertion), and clear.
make_notebook
Section titled “make_notebook”def make_notebook( *, name: str = "notebook", description: str = DEFAULT_NOTEBOOK_DESCRIPTION, max_notebook_size_bytes: int = _DEFAULT_MAX_NOTEBOOK_SIZE_BYTES) -> DecoratedFunctionToolDefined in: src/strands/vended_tools/notebook/notebook.py:37
Create a notebook tool.
Arguments:
name- Tool name exposed to the model. Defaults to"notebook".description- Tool description shown to the model.max_notebook_size_bytes- Maximum size of a single notebook’s content in bytes (UTF-8 encoded). Defaults to 1 MiB.
Returns:
A decorated tool that manages text notebooks in agent state.
Raises:
ValueError- Ifnameis empty, ormax_notebook_size_bytesis not a positive integer.
notebook
Section titled “notebook”Default notebook tool.