Croway commented on code in PR #27812:
URL: https://github.com/apache/camel/pull/27812#discussion_r4271757672
##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/McpSecurityInterceptor.java:
##########
@@ -128,7 +131,11 @@ private void sanitizeParameters(InvocationContext ctx) {
if (params[i] instanceof String s) {
String clean = stripControlChars(s);
if (clean.length() > maxLen) {
- clean = clean.substring(0, maxLen);
+ // rejected, never cut: a shortened file content or
replacement would be written as if complete
+ throw new ToolCallException(
+ "Argument '" + parameterName(ctx.getMethod(), i) +
"' is " + clean.length()
+ + " characters long, over the
limit of " + maxLen
+ + "
(camel.mcp.security.max-argument-length); nothing was done");
Review Comment:
Correction: this PR was already merged when I pushed that commit, so it
never reached main. The change is in https://github.com/apache/camel/pull/27837.
_Claude Code on behalf of Croway_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]