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

Function readOptionalLimit

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

Source from the content-addressed store, hash-verified

254 typeof value === "object" && value !== null && !Array.isArray(value);
255
256const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
257 if (value === undefined) {
258 return 12;
259 }
260
261 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
262 return new ExecutionToolError({
263 message: `${toolName} limit must be a positive number when provided`,
264 });
265 }
266
267 return Math.floor(value);
268};
269
270const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
271 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected