MCPcopy Create free account
hub / github.com/astercloud/aster / writeJSON

Function writeJSON

pkg/mcpserver/server.go:168–172  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, v any)

Source from the content-addressed store, hash-verified

166}
167
168func writeJSON(w http.ResponseWriter, status int, v any) {
169 w.Header().Set("Content-Type", "application/json; charset=utf-8")
170 w.WriteHeader(status)
171 _ = json.NewEncoder(w).Encode(v)
172}
173
174func writeError(w http.ResponseWriter, id int64, code int, msg string, err error) {
175 m := msg

Callers 3

handleToolsListMethod · 0.70
handleToolsCallMethod · 0.70
writeErrorFunction · 0.70

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected