We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
package remedy
import (
"os"
"github.com/goccy/go-json"
)
type State struct {
aggregation *Aggregation
Filepath string
}
func (state *State) Initialize() error {
initialAgg := Aggregation{} //nolint:exhaustruct
initialAggToPersist := ConvertToPersisted(initialAgg)
bytes, err := json.Marshal(initialAggToPersist)
if err != nil {
return err
}
state.aggregation = &initialAgg
return os.WriteFile(state.Filepath, bytes, 0o644)
}
func (state *State) UpdateAggregation(aggregation *Aggregation) error {
state.aggregation = aggregation
bytes, err := json.Marshal(ConvertToPersisted(*state.aggregation))
if err != nil {
return err
}
return os.WriteFile(state.Filepath, bytes, os.ModeAppend)
}