MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / truncate

Function truncate

packages/core/execution/src/engine.ts:144–147  ·  view source on GitHub ↗
(value: string, max: number)

Source from the content-addressed store, hash-verified

142const MAX_PREVIEW_CHARS = 30_000;
143
144const truncate = (value: string, max: number): string =>
145 value.length > max
146 ? `${value.slice(0, max)}\n... [truncated ${value.length - max} chars]`
147 : value;
148
149const soleConnectedToolName = (toolPaths: readonly string[] | undefined): string | undefined => {
150 const names = [...new Set(toolPaths ?? [])];

Callers 1

formatExecuteResultFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected