MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / requiredString

Function requiredString

projects/runtime-node/src/agents.ts:336–340  ·  view source on GitHub ↗
(params: unknown, key: string)

Source from the content-addressed store, hash-verified

334}
335
336function requiredString(params: unknown, key: string): string {
337 const value = asRecord(params)[key]
338 if (typeof value !== "string" || value.length < 1) throw new Error(`${key} is required`)
339 return value
340}
341
342function optionalString(value: unknown): string | undefined {
343 return typeof value === "string" && value.length > 0 ? value : undefined

Callers 2

providerIdFunction · 0.70

Calls 1

asRecordFunction · 0.70

Tested by

no test coverage detected