nbinlineai.tools

Opt-in kernel and notebook tools for AI prompt cells.

Saved-notebook readers and fastcore-backed file tools use the kernel filesystem. Live cell tools are dispatched by the JupyterLab extension; their Python stubs are intentionally not callable directly.

search_kernel_names

source

search_kernel_names(query: str, limit: int = 20) -> str

Find live Python kernel names containing a literal query, with types only.

Parameter Type Default Description
query str required Literal fragment in a live kernel name.
limit int 20 Maximum names, from 1 through 50.
returns str Matching names and types, with no value reprs.

list_notebooks

source

list_notebooks(path: str = '.', limit: int = 30) -> str

List saved .ipynb paths, skipping hidden and environment directories.

Parameter Type Default Description
path str '.' Directory relative to kernel cwd, or absolute.
limit int 30 Maximum paths, from 1 through 100.
returns str Saved notebook paths, not content.

find_notebook_cells

source

find_notebook_cells(path: str, query: str, limit: int = 10) -> str

Find saved notebook cells by case-insensitive literal source text.

Parameter Type Default Description
path str required Saved .ipynb path relative to kernel cwd, or absolute.
query str required Case-insensitive literal source fragment.
limit int 10 Maximum matching cells, from 1 through 50.
returns str Matching cell references and short source snippets.

read_notebook_cell

source

read_notebook_cell(path: str, cell_id: str, start_line: int = 1, end_line: int = 40) -> str

Read numbered saved cell source by ID or zero-based index:N fallback.

Parameter Type Default Description
path str required Saved .ipynb path relative to kernel cwd, or absolute.
cell_id str required Exact ID, or index:N for a zero-based fallback.
start_line int 1 First one-based source line, inclusive.
end_line int 40 Last one-based source line, inclusive.
returns str Numbered saved source excerpt.

inspect_python

source

inspect_python(name: str, section: str = 'help') -> str

Inspect a live Python name’s help, signature, or available source.

Parameter Type Default Description
name str required Explicit public name in the live kernel or builtins.
section str 'help' help, signature, or source.
returns str Bounded documentation, signature, or source excerpt.

read_url

source

read_url(url: str) -> str

Read a public web page as bounded, sanitized Markdown with its source URL.

Parameter Type Default Description
url str required Public HTTP(S) documentation page.
returns str Short source-attributed Markdown excerpt.

list_cells

source

list_cells(start: int = 0, limit: int = 20) -> str

List live notebook cells, including unsaved edits, by ID and position.

Parameter Type Default Description
start int 0 First zero-based live notebook cell.
limit int 20 Maximum cells to summarize.
returns str Live notebook cell IDs, types, and brief source previews.

read_cell

source

read_cell(cell_id: str, start_line: int = 1, end_line: int = 40) -> str

Read live notebook cell source, including unsaved edits, by cell ID.

Parameter Type Default Description
cell_id str required Live cell ID returned by list_cells.
start_line int 1 First one-based source line, inclusive.
end_line int 40 Last one-based source line, inclusive.
returns str Bounded numbered live cell source excerpt.

insert_markdown

source

insert_markdown(content: str, after_cell_id: str = '') -> str

Insert a Markdown note into the current live notebook after a cell.

Parameter Type Default Description
content str required Markdown source to insert as a new notebook cell.
after_cell_id str '' Optional live cell ID to insert after.
returns str Confirmation of the requested notebook insertion.

insert_code

source

insert_code(content: str, after_cell_id: str = '') -> str

Insert an unexecuted code cell below the AI answer, or after a chosen cell.

Parameter Type Default Description
content str required Python source to insert as a new unexecuted code cell.
after_cell_id str '' Optional live cell ID to insert after.
returns str Confirmation only after the browser inserts the cell.

url_to_note

source

url_to_note(url: str, after_cell_id: str = '') -> str

Fetch a public page and insert its bounded Markdown as a notebook note.

Parameter Type Default Description
url str required Public HTTP(S) page to summarize as source-attributed Markdown.
after_cell_id str '' Optional live cell ID to insert after.
returns str Confirmation of the requested notebook insertion.

tool_catalog

source

tool_catalog(group: str = '') -> str

List available tool groups and names without enabling any functions.

Parameter Type Default Description
group str '' Optional group name, or empty for every group.
returns str A setup reference without enabled tool declarations.

tools_markdown

source

tools_markdown(names: list[str] | None = None, custom: Mapping[str, Callable[..., Any]] | None = None, group: str = 'starter') -> str

Print chosen built-in/custom references; this does not register a tool.

Parameter Type Default Description
names list[str] | None None Explicit names, or the selected group’s tools.
custom Mapping[str, Callable[…, Any]] | None None Explicit custom alias-to-callable map.
group str 'starter' Tool group used when names is omitted.
returns str Markdown with one removable reference per tool.

insert_tools

source

insert_tools(names: list[str] | None = None, custom: Mapping[str, Callable[..., Any]] | None = None, group: str = 'starter') -> InsertToolsReceipt

Request a Markdown tool-reference cell immediately below this code cell.

The nbinlineai JupyterLab extension inserts into the live notebook model. The returned receipt starts as requested and later says inserted or error; save the notebook after the new cell appears. No model or API key is used.

Parameter Type Default Description
names list[str] | None None Explicit names, or the selected group’s tools.
custom Mapping[str, Callable[…, Any]] | None None Explicit custom aliases.
group str 'starter' Tool group used when names is omitted.
returns InsertToolsReceipt Asynchronous status of the new Markdown cell.

insert_tool_catalog

source

insert_tool_catalog(group: str = 'starter') -> InsertToolsReceipt

Insert a catalog group’s editable & references below this code cell.

Import the group’s functions into the notebook kernel first. The default starter group offers 19 tools; tool_catalog() lists all available groups. Inspect the returned receipt in a later code cell and save the notebook. Use insert_tools(names=[…]) for individual tools or custom aliases.

Parameter Type Default Description
group str 'starter' Catalog group to declare; tool_catalog() lists choices.
returns InsertToolsReceipt Asynchronous status of the new Markdown cell.