init
diff --git a/tools/tool.go b/tools/tool.go
new file mode 100644
index 0000000..c99fa56
--- /dev/null
+++ b/tools/tool.go
@@ -0,0 +1,44 @@
+package tools
+
+import (
+ "github.com/invopop/jsonschema"
+)
+
+type Tool interface {
+ Name() string
+ Description() string
+ InputSchema() *jsonschema.Schema
+ Call(inp string) (string, error)
+}
+
+type Registry interface {
+ All() []Tool
+ Add(tool Tool)
+ Get(name string) Tool
+}
+
+type InMemoryRegistry struct {
+ tools map[string]Tool
+}
+
+func NewInMemoryRegistry() *InMemoryRegistry {
+ return &InMemoryRegistry{
+ make(map[string]Tool),
+ }
+}
+
+func (r *InMemoryRegistry) Add(tool Tool) {
+ r.tools[tool.Name()] = tool
+}
+
+func (r *InMemoryRegistry) All() []Tool {
+ var ret []Tool
+ for _, t := range r.tools {
+ ret = append(ret, t)
+ }
+ return ret
+}
+
+func (r *InMemoryRegistry) Get(name string) Tool {
+ return r.tools[name]
+}