MCPcopy
hub / github.com/simstudioai/sim / parsedOutputTooLargeResponse

Function parsedOutputTooLargeResponse

apps/sim/app/api/files/parse/route.ts:394–406  ·  view source on GitHub ↗
(results?: unknown[])

Source from the content-addressed store, hash-verified

392}
393
394function parsedOutputTooLargeResponse(results?: unknown[]): NextResponse {
395 const hasPartialResults = Boolean(results && results.length > 0)
396 return NextResponse.json(
397 {
398 success: hasPartialResults,
399 error: `Parsed file output is too large to return safely. Maximum combined parsed output is ${prettySize(
400 MAX_MULTI_FILE_PARSE_OUTPUT_BYTES
401 )}.`,
402 ...(results && results.length > 0 ? { results } : {}),
403 },
404 { status: hasPartialResults ? 200 : 413 }
405 )
406}
407
408function getParsedOutputTooLargeMessage(maxBytes: number): string {
409 return `Parsed file output is too large to return safely. Maximum parsed output is ${prettySize(

Callers 1

route.tsFile · 0.85

Calls 1

prettySizeFunction · 0.85

Tested by

no test coverage detected