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

Function readOptionalLimit

packages/core/execution/src/engine.ts:314–326  ·  view source on GitHub ↗
(value: unknown, toolName: string)

Source from the content-addressed store, hash-verified

312 typeof value === "object" && value !== null && !Array.isArray(value);
313
314const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
315 if (value === undefined) {
316 return 12;
317 }
318
319 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
320 return new ExecutionToolError({
321 message: `${toolName} limit must be a positive number when provided`,
322 });
323 }
324
325 return Math.floor(value);
326};
327
328const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
329 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected