MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / GetAPISchemasFiltered

Method GetAPISchemasFiltered

tools/registry.go:160–177  ·  view source on GitHub ↗
(enabledOnly bool, deny map[string]struct{}, readOnlyOnly bool)

Source from the content-addressed store, hash-verified

158}
159
160func (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
179func (r *ToolRegistry) Execute(ctx context.Context, call ToolCall, execCtx ExecutionContext) ToolResult {
180 if execCtx == nil {

Calls 5

ListToolsMethod · 0.95
NameMethod · 0.65
IsEnabledMethod · 0.65
IsReadOnlyMethod · 0.65
ToAPISchemaMethod · 0.65