Skip to content

Commit 50fc2c2

Browse files
committed
feat: add list_tools utility and update README with comprehensive tool documentation
1 parent be9f204 commit 50fc2c2

2 files changed

Lines changed: 127 additions & 25 deletions

File tree

README.md

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -479,33 +479,51 @@ Sofia integrates directly with the Bitcoin blockchain, allowing for both public
479479
480480
| Tool | Description |
481481
|---|---|
482-
| `file_read` / `file_write` / `file_edit` | Read, write, and edit files |
483-
| `shell` | Run terminal commands |
484-
| `web_browse` | Autonomous web browsing via Playwright |
482+
| `a2a` | Agent-to-Agent communication (send, receive, and broadcast messages) |
483+
| `ab_test` / `analyze` | Run comparative A/B task testing framework and analyze results |
484+
| `bitcoin` | Local HD wallet management, UTXOs, and public blockchain queries |
485+
| `checkpoint` / `archive` | Agent state rollback checkpoints and workspace archiving |
485486
| `computer_use` | Control the computer's screen, mouse, and keyboard |
486-
| `image_analyze` | Analyze local images via vision-LLM |
487-
| `orchestrate` | Multi-agent orchestration with dependency graphs |
488-
| `spawn` / `subagent` | Launch asynchronous/synchronous sub-agents |
489-
| `a2a` | Agent-to-Agent communication (send/receive/broadcast) |
490-
| `plan` | Structured task planning |
491-
| `scratchpad` | Shared key-value store between agents |
492-
| `cron` | Create and manage scheduled jobs |
493-
| `message` | Send messages to chat channels |
494-
| `gogcli` | Google Gmail, Calendar, and Drive |
495-
| `knowledge_graph` | Knowledge graph — add, search, and delete facts and relations |
496-
| `manage_goals` | Create, update, and track long-term goals |
497-
| `manage_triggers` | Create context-aware triggers for conditional actions |
498-
| `create_skill` | Automatically create new skills from successful approaches |
499-
| `update_skill` | Refine existing skills based on feedback |
500-
| `distill_knowledge` | Distill experiences into reusable knowledge |
501-
| `self_modify` | Code/configuration self-modification with safety guardrails |
502-
| `notify_user` | Push notifications to the user's desktop |
503-
| `get_tool_stats` | Fetch performance data and success rates for tools |
504-
| `create_pipeline` | Create a new macro tool by chaining existing tools |
505-
| `mcp` | Connect to external MCP servers for dynamic tools |
506-
| `domain_name` | Manage domains via Porkbun (check, register, dns, nameservers) |
507487
| `cpanel` | Manage cPanel web hosting (files, domains, databases, SSL) |
508-
| `bitcoin` | Bitcoin integration: local HD wallet management, UTXOs, send transactions, and public queries |
488+
| `create_agent` | Dynamically create new specialized sub-agents on the fly |
489+
| `create_pipeline` | Compose a new reusable macro tool by chaining existing tools |
490+
| `create_skill` / `update_skill` | Automatically create or refine skills from successful approaches |
491+
| `cron` | Create and manage scheduled background jobs |
492+
| `database` | Direct interaction with local and remote SQL databases |
493+
| `distill_knowledge` | Compress and distill vast experiences into reusable knowledge |
494+
| `dns` / `domain_name` | DNS lookup and complete domain management (via Porkbun) |
495+
| `docker` / `docker_compose` | Manage local Docker environments, containers, and compose stacks |
496+
| `ffmpeg` | Process and manipulate local media and audio files directly |
497+
| `read_file` / `write_file` / `edit_file` / `list_dir` | Read, write, list files, and perform precision targeted line edits |
498+
| `get_tool_stats` | Fetch performance data, speed, and success rates for all tools |
499+
| `git` / `github_cli` | Complete workspace version control and cloud repository management |
500+
| `glob` / `grep` / `jq` | Advanced file searching, regex matching, and structured JSON parsing |
501+
| `gogcli` | Secure Google Services integrations (Gmail, Calendar, Drive) |
502+
| `http` / `web_fetch` | Make rich HTTP API requests or cleanly fetch raw web text/HTML |
503+
| `i2c` / `spi` | Interact directly with hardware bus peripherals and sensors |
504+
| `image_analyze` | Analyze local visual media (PNG, JPEG, GIF, WebP) via vision-LLM |
505+
| `knowledge_graph` | Semantic memory — add, search, and delete entity relations |
506+
| `kubectl` | Manage and observe external Kubernetes clusters and pods |
507+
| `manage_goals` | Create, update, track, and pursue persistent long-term goals |
508+
| `manage_triggers` | Create context-aware conversational listeners for conditional actions |
509+
| `mcp` / `mcp_tool` | Connect to Model Context Protocol servers to load dynamic tools |
510+
| `message` / `notify_user` | Push OS-level notifications or send direct messages to chat channels |
511+
| `orchestrate` | Multi-agent topological orchestration with complex dependency graphs |
512+
| `pandoc` / `template` | Document format conversion and dynamic prompt template rendering |
513+
| `plan` | Create, update, and hierarchically manage task execution plans |
514+
| `practice_past_failures`| Spawn sandbox agents to independently retry and resolve past failed tasks |
515+
| `recipe` | Discover and run pre-configured reusable agent workflows |
516+
| `scratchpad` | Shared memory key-value store for cross-agent data sharing |
517+
| `screenshot` | Capture the host machine's desktop view for visual analysis |
518+
| `search_history` | Semantic vector search through the entire previous chat history |
519+
| `security` / `semgrep`| Run static analysis, vulnerability validation, and egress inspection |
520+
| `self_modify` | Config and source-code self-modification with strict safety guardrails |
521+
| `exec` | Execute raw bash/zsh shell commands safely inside the workspace |
522+
| `spawn` / `subagent` | Launch asynchronous background or synchronous sub-agents |
523+
| `task` / `todo` | Context-aware checklist tracking and cross-session to-do execution |
524+
| `terraform` | Manage scalable infrastructure state and applies via Terraform |
525+
| `vercel` | Deploy and control serverless cloud web deployments via Vercel |
526+
| `web_browse` | Autonomously browse websites using Chromium Playwright integration |
509527
510528
511529
---

list_tools.go

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"go/ast"
6+
"go/parser"
7+
"go/token"
8+
"strings"
9+
"sort"
10+
)
11+
12+
func main() {
13+
fset := token.NewFileSet()
14+
pkgs, err := parser.ParseDir(fset, "./pkg/tools", nil, 0)
15+
if err != nil {
16+
panic(err)
17+
}
18+
19+
type Tool struct {
20+
Name string
21+
Desc string
22+
}
23+
tools := make(map[string]*Tool)
24+
25+
for _, pkg := range pkgs {
26+
for _, file := range pkg.Files {
27+
for _, decl := range file.Decls {
28+
if fd, ok := decl.(*ast.FuncDecl); ok && fd.Recv != nil {
29+
recvName := ""
30+
switch expr := fd.Recv.List[0].Type.(type) {
31+
case *ast.StarExpr:
32+
if ident, ok := expr.X.(*ast.Ident); ok {
33+
recvName = ident.Name
34+
}
35+
case *ast.Ident:
36+
recvName = expr.Name
37+
}
38+
39+
if recvName == "" {
40+
continue
41+
}
42+
43+
if tools[recvName] == nil {
44+
tools[recvName] = &Tool{}
45+
}
46+
47+
if fd.Name.Name == "Name" {
48+
for _, stmt := range fd.Body.List {
49+
if ret, ok := stmt.(*ast.ReturnStmt); ok && len(ret.Results) > 0 {
50+
if basicLit, ok := ret.Results[0].(*ast.BasicLit); ok && basicLit.Kind == token.STRING {
51+
tools[recvName].Name = strings.Trim(basicLit.Value, "\"")
52+
} else if ident, ok := ret.Results[0].(*ast.Ident); ok {
53+
tools[recvName].Name = ident.Name // e.g., variable return
54+
}
55+
}
56+
}
57+
}
58+
59+
if fd.Name.Name == "Description" {
60+
for _, stmt := range fd.Body.List {
61+
if ret, ok := stmt.(*ast.ReturnStmt); ok && len(ret.Results) > 0 {
62+
if basicLit, ok := ret.Results[0].(*ast.BasicLit); ok && basicLit.Kind == token.STRING {
63+
tools[recvName].Desc = strings.Trim(basicLit.Value, "\"`\n")
64+
tools[recvName].Desc = strings.Split(tools[recvName].Desc, "\n")[0] // Just first line
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
74+
var results []string
75+
for _, t := range tools {
76+
if t.Name != "" && t.Name != "c.name" && t.Name != "t.name" && t.Name != "m.name" && t.Name != "finalOutputToolName" && !strings.Contains(t.Name,"mock") && t.Desc != "" {
77+
results = append(results, fmt.Sprintf("| `%s` | %s |", t.Name, t.Desc))
78+
}
79+
}
80+
sort.Strings(results)
81+
for _, res := range results {
82+
fmt.Println(res)
83+
}
84+
}

0 commit comments

Comments
 (0)