MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / StripAndCaptureInjectedMessages

Function StripAndCaptureInjectedMessages

internal/toolinjection/strip.go:29–35  ·  view source on GitHub ↗

StripAndCaptureInjectedMessages removes injected tool call / result pairs and also extracts the content of tool results produced by injected calls.

(rawJSON []byte, format string)

Source from the content-addressed store, hash-verified

27// StripAndCaptureInjectedMessages removes injected tool call / result pairs
28// and also extracts the content of tool results produced by injected calls.
29func StripAndCaptureInjectedMessages(rawJSON []byte, format string) ([]byte, []CapturedResult) {
30 f := GetFormat(format)
31 if f == nil {
32 return rawJSON, nil
33 }
34 return f.StripAndCapture(rawJSON)
35}
36
37// messageHasInjectedContent checks if a message contains injected tool call IDs.
38func messageHasInjectedContent(msg gjson.Result, format string) bool {

Calls 2

GetFormatFunction · 0.85
StripAndCaptureMethod · 0.65