MCPcopy Create free account
hub / github.com/braintrustdata/bash-agent-evals / truncateOutput

Function truncateOutput

src/tools/sql-tools.ts:9–13  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

7const MAX_OUTPUT_CHARS = 30000;
8
9function truncateOutput(output: string): string {
10 if (output.length <= MAX_OUTPUT_CHARS) return output;
11 const truncated = output.slice(0, MAX_OUTPUT_CHARS);
12 return `${truncated}\n\n[OUTPUT TRUNCATED: showing ${MAX_OUTPUT_CHARS.toLocaleString()} of ${output.length.toLocaleString()} characters. Use LIMIT or more specific WHERE clauses to narrow results.]`;
13}
14
15// Use createRequire to load better-sqlite3 from the actual node_modules path
16// This bypasses the Braintrust CLI's eval bundling which breaks native modules

Callers 1

sql-tools.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected