* Implement DescribeTool for listing available MCP tools with annotations. * Add UpsertToolAnnotation and GetToolAnnotations methods for managing tool notes. * Create tool_annotations table for storing tool usage notes.
34 lines
619 B
Go
34 lines
619 B
Go
package app
|
|
|
|
import (
|
|
"embed"
|
|
"fmt"
|
|
"io/fs"
|
|
)
|
|
|
|
var (
|
|
//go:embed static/*
|
|
staticFiles embed.FS
|
|
|
|
faviconICO = mustReadStaticFile("favicon.ico")
|
|
homeImage = mustReadStaticFile("avelonmemorycrystal.jpg")
|
|
iconImage = tryReadStaticFile("icon.png")
|
|
)
|
|
|
|
func mustReadStaticFile(name string) []byte {
|
|
data, err := fs.ReadFile(staticFiles, "static/"+name)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("failed to read embedded static file %q: %v", name, err))
|
|
}
|
|
|
|
return data
|
|
}
|
|
|
|
func tryReadStaticFile(name string) []byte {
|
|
data, err := fs.ReadFile(staticFiles, "static/"+name)
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
return data
|
|
}
|