Skip to main content

MAX_GENERATED_FILES

Constant MAX_GENERATED_FILES 

Source
pub const MAX_GENERATED_FILES: usize = _; // 1_005usize
Expand description

Maximum number of files a single generate/generate_with_categories call will produce (denial-of-service protection, CWE-400).

Each tool becomes its own .ts file, so this bounds the file-count amplification of a single generation run. Derived directly from mcp_execution_introspector::MAX_TOOL_COUNT (rather than an independently chosen number) plus this module’s FIXED_FILE_COUNT, so a ServerInfo that already cleared introspection’s own tool-count bound can never be deterministically rejected here for simply having “as many tools as introspection already allows” (issue #198 M1). This check remains meaningful defense-in-depth for callers that construct a ServerInfo directly rather than going through introspection.

§Examples

use mcp_execution_codegen::progressive::generator::MAX_GENERATED_FILES;

assert!(MAX_GENERATED_FILES > 0);