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

Function readOptionalLimit

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

Source from the content-addressed store, hash-verified

187 typeof value === "object" && value !== null && !Array.isArray(value);
188
189const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
190 if (value === undefined) {
191 return 12;
192 }
193
194 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
195 return new ExecutionToolError({
196 message: `${toolName} limit must be a positive number when provided`,
197 });
198 }
199
200 return Math.floor(value);
201};
202
203const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
204 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected