MCPcopy Index your code
hub / github.com/simstudioai/sim / jsonSize

Function jsonSize

apps/sim/lib/mcp/tool-limits.ts:16–23  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

14}
15
16function jsonSize(value: unknown): number | null {
17 try {
18 const json = JSON.stringify(value)
19 return typeof json === 'string' ? utf8Size(json) : null
20 } catch {
21 return null
22 }
23}
24
25export interface McpToolMetadataSizes {
26 toolNameBytes: number

Callers 2

getMcpToolMetadataSizesFunction · 0.85

Calls 1

utf8SizeFunction · 0.85

Tested by

no test coverage detected