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

Function redactToolJSONValue

internal/cli/client_tools.go:253–274  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

251}
252
253func redactToolJSONValue(value any) any {
254 switch typed := value.(type) {
255 case map[string]any:
256 for key, item := range typed {
257 if sensitiveToolFieldName(key) {
258 typed[key] = "[REDACTED]"
259 continue
260 }
261 typed[key] = redactToolJSONValue(item)
262 }
263 return typed
264 case []any:
265 for i, item := range typed {
266 typed[i] = redactToolJSONValue(item)
267 }
268 return typed
269 case string:
270 return redactToolDiagnostic(typed)
271 default:
272 return typed
273 }
274}
275
276func redactToolMetadata(metadata map[string]json.RawMessage) map[string]json.RawMessage {
277 if len(metadata) == 0 {

Callers 1

redactToolRawJSONFunction · 0.85

Calls 2

sensitiveToolFieldNameFunction · 0.85
redactToolDiagnosticFunction · 0.85

Tested by

no test coverage detected