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

Function readOptionalLimit

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

Source from the content-addressed store, hash-verified

213 typeof value === "object" && value !== null && !Array.isArray(value);
214
215const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
216 if (value === undefined) {
217 return 12;
218 }
219
220 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
221 return new ExecutionToolError({
222 message: `${toolName} limit must be a positive number when provided`,
223 });
224 }
225
226 return Math.floor(value);
227};
228
229const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
230 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected