MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / cellContentToToolResult

Function cellContentToToolResult

source code/utils/notebook.ts:121–134  ·  view source on GitHub ↗
(cell: NotebookCellSource)

Source from the content-addressed store, hash-verified

119}
120
121function cellContentToToolResult(cell: NotebookCellSource): TextBlockParam {
122 const metadata = []
123 if (cell.cellType !== 'code') {
124 metadata.push(`<cell_type>${cell.cellType}</cell_type>`)
125 }
126 if (cell.language !== 'python' && cell.cellType === 'code') {
127 metadata.push(`<language>${cell.language}</language>`)
128 }
129 const cellContent = `<cell id="${cell.cell_id}">${metadata.join('')}${cell.source}</cell id="${cell.cell_id}">`
130 return {
131 text: cellContent,
132 type: 'text',
133 }
134}
135
136function cellOutputToToolResult(output: NotebookCellSourceOutput) {
137 const outputs: (TextBlockParam | ImageBlockParam)[] = []

Callers 1

getToolResultFromCellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected