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

Method getToolContext

pkg/tools/bridge/http_server.go:216–229  ·  view source on GitHub ↗

getToolContext 获取工具上下文

()

Source from the content-addressed store, hash-verified

214
215// getToolContext 获取工具上下文
216func (s *HTTPBridgeServer) getToolContext() *tools.ToolContext {
217 s.mu.RLock()
218 factory := s.contextFactory
219 s.mu.RUnlock()
220
221 if factory != nil {
222 return factory()
223 }
224
225 // 默认返回空上下文
226 return &tools.ToolContext{
227 Services: make(map[string]any),
228 }
229}
230
231// sendJSON 发送 JSON 响应
232func (s *HTTPBridgeServer) sendJSON(w http.ResponseWriter, data any) {

Callers 1

handleToolCallMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected