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

Function cellContentToToolResult

src/utils/notebook.ts:119–132  ·  view source on GitHub ↗
(cell: NotebookCellSource)

Source from the content-addressed store, hash-verified

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

Callers 1

getToolResultFromCellFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected