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

Method handleToolList

pkg/tools/bridge/http_server.go:164–174  ·  view source on GitHub ↗

handleToolList 处理工具列表请求

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

162
163// handleToolList 处理工具列表请求
164func (s *HTTPBridgeServer) handleToolList(w http.ResponseWriter, r *http.Request) {
165 if r.Method != http.MethodGet {
166 http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
167 return
168 }
169
170 tools := s.bridge.ListAvailableTools()
171 s.sendJSON(w, map[string]any{
172 "tools": tools,
173 })
174}
175
176// handleToolSchema 处理工具 Schema 请求(带缓存)
177func (s *HTTPBridgeServer) handleToolSchema(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

sendJSONMethod · 0.95
ListAvailableToolsMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected