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

Function collectToolNames

internal/toolinjection/injection.go:115–126  ·  view source on GitHub ↗

collectToolNames returns a set of tool function names present in the request.

(rawJSON []byte, format string)

Source from the content-addressed store, hash-verified

113
114// collectToolNames returns a set of tool function names present in the request.
115func collectToolNames(rawJSON []byte, format string) map[string]struct{} {
116 f := GetFormat(format)
117 if f == nil {
118 return nil
119 }
120 names := f.CollectToolNames(rawJSON)
121 set := make(map[string]struct{}, len(names))
122 for _, n := range names {
123 set[n] = struct{}{}
124 }
125 return set
126}
127
128// collectToolNamesOpenAI extracts tool function names from an OpenAI request.
129func collectToolNamesOpenAI(rawJSON []byte) []string {

Callers 1

ShouldInjectFunction · 0.85

Calls 2

GetFormatFunction · 0.85
CollectToolNamesMethod · 0.65

Tested by

no test coverage detected