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

Method List

internal/observedtools/store.go:85–104  ·  view source on GitHub ↗

List returns all observed tools sorted by format then name.

()

Source from the content-addressed store, hash-verified

83
84// List returns all observed tools sorted by format then name.
85func (s *Store) List() []ObservedTool {
86 s.mu.RLock()
87 defer s.mu.RUnlock()
88
89 if len(s.tools) == 0 {
90 return nil
91 }
92
93 out := make([]ObservedTool, 0, len(s.tools))
94 for _, t := range s.tools {
95 out = append(out, t)
96 }
97 sort.Slice(out, func(i, j int) bool {
98 if out[i].Format != out[j].Format {
99 return out[i].Format < out[j].Format
100 }
101 return out[i].Name < out[j].Name
102 })
103 return out
104}
105
106// Clear removes all observed tools.
107func (s *Store) Clear() {

Callers 5

TestRecord_ClaudeFunction · 0.95
TestRecord_OpenAIFunction · 0.95
TestRecord_NoToolsFunction · 0.95
TestRecord_DedupFunction · 0.95
TestClearFunction · 0.95

Calls

no outgoing calls

Tested by 5

TestRecord_ClaudeFunction · 0.76
TestRecord_OpenAIFunction · 0.76
TestRecord_NoToolsFunction · 0.76
TestRecord_DedupFunction · 0.76
TestClearFunction · 0.76