| 158 | } |
| 159 | |
| 160 | func (r *ToolRegistry) GetAPISchemasFiltered(enabledOnly bool, deny map[string]struct{}, readOnlyOnly bool) []map[string]any { |
| 161 | tools := r.ListTools() |
| 162 | sort.Slice(tools, func(i, j int) bool { return tools[i].Name() < tools[j].Name() }) |
| 163 | out := make([]map[string]any, 0, len(tools)) |
| 164 | for _, tool := range tools { |
| 165 | if enabledOnly && !tool.IsEnabled() { |
| 166 | continue |
| 167 | } |
| 168 | if _, ok := deny[tool.Name()]; ok { |
| 169 | continue |
| 170 | } |
| 171 | if readOnlyOnly && !tool.IsReadOnly(nil) { |
| 172 | continue |
| 173 | } |
| 174 | out = append(out, tool.ToAPISchema()) |
| 175 | } |
| 176 | return out |
| 177 | } |
| 178 | |
| 179 | func (r *ToolRegistry) Execute(ctx context.Context, call ToolCall, execCtx ExecutionContext) ToolResult { |
| 180 | if execCtx == nil { |