MCPcopy Create free account
hub / github.com/compozy/agh / ListSessionTools

Method ListSessionTools

internal/api/core/tools.go:180–196  ·  view source on GitHub ↗

ListSessionTools returns the session/model-callable projection.

(c *gin.Context)

Source from the content-addressed store, hash-verified

178
179// ListSessionTools returns the session/model-callable projection.
180func (h *BaseHandlers) ListSessionTools(c *gin.Context) {
181 if h.Tools == nil {
182 h.respondError(c, http.StatusServiceUnavailable, errors.New("tool registry is not configured"))
183 return
184 }
185 routeScope, routeSessionID, _, ok := h.routeSessionInWorkspace(c)
186 if !ok {
187 return
188 }
189 scope := h.sessionToolScope(c, routeScope.ID, routeSessionID)
190 views, err := h.Tools.List(c.Request.Context(), scope)
191 if err != nil {
192 h.respondToolError(c, err)
193 return
194 }
195 c.JSON(http.StatusOK, contract.ToolsResponse{Tools: ToolPayloadsFromViews(views)})
196}
197
198// SearchSessionTools searches only within the session/model-callable projection.
199func (h *BaseHandlers) SearchSessionTools(c *gin.Context) {

Callers

nothing calls this directly

Calls 6

respondErrorMethod · 0.95
sessionToolScopeMethod · 0.95
respondToolErrorMethod · 0.95
ToolPayloadsFromViewsFunction · 0.85
ListMethod · 0.65

Tested by

no test coverage detected