Skip to main content

MAX_GENERATED_BYTES

Constant MAX_GENERATED_BYTES 

Source
pub const MAX_GENERATED_BYTES: usize = _; // 147_968_000usize
Expand description

Maximum total bytes across every file in a single generate/generate_with_categories call’s output (denial-of-service protection, CWE-400).

Derived from mcp_execution_introspector’s own per-tool bounds — up to MAX_TOOL_COUNT tools, each up to MAX_TOOL_NAME_LEN + MAX_TOOL_DESCRIPTION_LEN + MAX_SCHEMA_SIZE_BYTES — rather than chosen independently, so a ServerInfo that already cleared introspection’s own bounds can never be deterministically rejected here for simply being “as large as introspection already allows” (issue #198 M1). The 2x multiplier accounts for _meta.json re-embedding every tool’s raw name/description/schema alongside the already-rendered .ts file content, roughly doubling the total.

§Examples

use mcp_execution_codegen::progressive::generator::MAX_GENERATED_BYTES;

assert!(MAX_GENERATED_BYTES > 0);