MCPcopy
hub / github.com/sipeed/picoclaw / GetSummaries

Method GetSummaries

pkg/tools/registry.go:505–524  ·  view source on GitHub ↗

GetSummaries returns human-readable summaries of all registered tools. Returns a slice of "name - description" strings.

()

Source from the content-addressed store, hash-verified

503// GetSummaries returns human-readable summaries of all registered tools.
504// Returns a slice of "name - description" strings.
505func (r *ToolRegistry) GetSummaries() []string {
506 r.mu.RLock()
507 defer r.mu.RUnlock()
508
509 sorted := r.sortedToolNames()
510 summaries := make([]string, 0, len(sorted))
511 for _, name := range sorted {
512 entry := r.tools[name]
513
514 if !entry.IsCore && entry.TTL <= 0 {
515 continue
516 }
517
518 summaries = append(
519 summaries,
520 fmt.Sprintf("- `%s` - %s", entry.Tool.Name(), entry.Tool.Description()),
521 )
522 }
523 return summaries
524}
525
526// GetAll returns all registered tools (both core and non-core with TTL > 0).
527// Used by SubTurn to inherit parent's tool set.

Callers 1

Calls 3

sortedToolNamesMethod · 0.95
NameMethod · 0.65
DescriptionMethod · 0.65

Tested by 1