MCPcopy Index your code
hub / github.com/deepnote/deepnote / convertSingleFileToDeepnote

Function convertSingleFileToDeepnote

packages/mcp/src/tools/conversion.ts:128–151  ·  view source on GitHub ↗

Converts one source notebook to a single-notebook `.deepnote` file.

(
  absoluteInput: string,
  format: SourceNotebookFormat,
  outputPath: string | undefined,
  projectName: string | undefined
)

Source from the content-addressed store, hash-verified

126
127/** Converts one source notebook to a single-notebook `.deepnote` file. */
128async function convertSingleFileToDeepnote(
129 absoluteInput: string,
130 format: SourceNotebookFormat,
131 outputPath: string | undefined,
132 projectName: string | undefined
133): Promise<ConvertToSuccessPayload> {
134 const finalOutputPath = await resolveConvertToOutputPath(outputPath, absoluteInput)
135 const finalProjectName = projectName || path.basename(absoluteInput, path.extname(absoluteInput))
136
137 await runToDeepnoteConversion(format, absoluteInput, {
138 projectName: finalProjectName,
139 outputPath: finalOutputPath,
140 })
141
142 return {
143 inputPath: absoluteInput,
144 outputPath: finalOutputPath,
145 detectedFormat: format,
146 projectName: finalProjectName,
147 inputFiles: [absoluteInput],
148 outputFiles: [finalOutputPath],
149 outputIsDirectory: false,
150 }
151}
152
153async function handleConvertTo(args: Record<string, unknown>) {
154 const parsedArgs = convertToArgsSchema.safeParse(args)

Callers 1

handleConvertToFunction · 0.70

Calls 2

runToDeepnoteConversionFunction · 0.90

Tested by

no test coverage detected