ListSessionTools returns the session/model-callable projection.
(c *gin.Context)
| 178 | |
| 179 | // ListSessionTools returns the session/model-callable projection. |
| 180 | func (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. |
| 199 | func (h *BaseHandlers) SearchSessionTools(c *gin.Context) { |
nothing calls this directly
no test coverage detected