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

Function readOptionalLimit

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

Source from the content-addressed store, hash-verified

263 typeof value === "object" && value !== null && !Array.isArray(value);
264
265const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
266 if (value === undefined) {
267 return 12;
268 }
269
270 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
271 return new ExecutionToolError({
272 message: `${toolName} limit must be a positive number when provided`,
273 });
274 }
275
276 return Math.floor(value);
277};
278
279const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
280 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected