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

Function readOptionalLimit

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

Source from the content-addressed store, hash-verified

232 typeof value === "object" && value !== null && !Array.isArray(value);
233
234const readOptionalLimit = (value: unknown, toolName: string): number | ExecutionToolError => {
235 if (value === undefined) {
236 return 12;
237 }
238
239 if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
240 return new ExecutionToolError({
241 message: `${toolName} limit must be a positive number when provided`,
242 });
243 }
244
245 return Math.floor(value);
246};
247
248const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
249 if (value === undefined) {

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected