MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / optionalNumber

Function optionalNumber

apps/desktop/src/mcp/server.ts:83–90  ·  view source on GitHub ↗
(args: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

81}
82
83function optionalNumber(args: Record<string, unknown>, key: string): number | undefined {
84 const value = args[key]
85 if (value == null) return undefined
86 if (typeof value !== 'number' || !Number.isFinite(value)) {
87 throw new Error(`${key} must be a number`)
88 }
89 return value
90}
91
92function optionalStringArray(args: Record<string, unknown>, key: string): string[] | undefined {
93 const value = args[key]

Callers 1

server.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected