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

Function readOptionalLimit

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

Source from the content-addressed store, hash-verified

287 typeof value === "object" && value !== null && !Array.isArray(value);
288
289const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
290 if (value === undefined) {
291 return 12;
292 }
293
294 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
295 return new ExecutionToolError({
296 message: `${toolName} limit must be a positive number when provided`,
297 });
298 }
299
300 return Math.floor(value);
301};
302
303const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
304 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected