You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/lexical/src/tools/definitions/insertBlock.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,18 @@ import { insertBlockParamsSchema } from '../schemas/insertBlock';
19
19
*
20
20
* Supports inserting various block types:
21
21
* - paragraph: Regular text paragraph
22
-
* - heading: Heading block (specify tag: h1-h6 in properties)
22
+
* - heading: Semantic HTML heading (NOT markdown - use plain text, specify tag property for h1-h6)
23
23
* - code: Code block (specify language in properties)
24
24
* - quote: Blockquote
25
25
* - list/listitem: List blocks
26
+
* - jupyter-cell: Executable Jupyter code cells
26
27
*/
27
28
exportconstinsertBlockTool: ToolDefinition={
28
29
name: 'datalayer_insertBlock',
29
30
displayName: 'Insert Lexical Block',
30
31
toolReferenceName: 'insertBlock',
31
32
description:
32
-
"IMPORTANT: Call readAllBlocks first to see the current document structure and determine the correct insertion point. Then, insert a single block into the currently open Lexical document. Specify block position using afterId: 'TOP' for beginning, 'BOTTOM' for end, or a specific block_id from readAllBlocks. Supports various block types (paragraph, heading, code, list-item, quote, etc.). Use listAvailableBlocks to see all supported types and required properties. Works on active .lexical file.",
33
+
"Insert different type of content with blocks. Use listAvailableBlocks to get availables blocks. When inserting MULTIPLE blocks sequentially (e.g., creating a document outline with heading + paragraph + code), ALWAYS use afterId: 'BOTTOM' for each insertion to append blocks in order. For single insertions, call readAllBlocks first to see document structure. Position blocks using afterId: 'TOP' (beginning), 'BOTTOM' (end - REQUIRED for sequential inserts), or specific block_id. IMPORTANT: heading blocks are semantic HTML (NOT markdown) - use plain text in source field without # symbols, specify tag property (h1-h6) instead. Use listAvailableBlocks to see all supported types. Works on active .lexical file.",
0 commit comments