MCPcopy Create free account
hub / github.com/apache/maka / assertJsonByteLimit

Function assertJsonByteLimit

packages/runtime-host/src/protocol/skill-catalog.ts:1230–1234  ·  view source on GitHub ↗
(value: unknown, maxBytes: number, label: string)

Source from the content-addressed store, hash-verified

1228}
1229
1230function assertJsonByteLimit(value: unknown, maxBytes: number, label: string): void {
1231 if (Buffer.byteLength(JSON.stringify(value), 'utf8') > maxBytes) {
1232 throw invalidProtocolFrame(`${label} exceeds byte limit`);
1233 }
1234}

Callers 3

decodeQueryResultFunction · 0.85
decodePreviewResultFunction · 0.85

Calls 1

invalidProtocolFrameFunction · 0.85

Tested by

no test coverage detected