Skip to content

Commit dc17bd8

Browse files
Copilotlpcox
andauthored
refactor: address code review - use logger.LogInfo for tool filtering, use client category for denied tool call warning
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/00582754-0d76-4bb6-a950-0cd6ff534f1b Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 35bf460 commit dc17bd8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/server/tool_registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (us *UnifiedServer) registerToolsFromBackend(serverID string) error {
199199
}
200200
}
201201
if n < len(listResult.Tools) {
202-
log.Printf("[allowed-tools] Filtered %d tools from %s: keeping %d of %d",
202+
logger.LogInfo("backend", "[allowed-tools] Filtered %d tools from %s: keeping %d of %d",
203203
len(listResult.Tools)-n, serverID, n, len(listResult.Tools))
204204
}
205205
listResult.Tools = listResult.Tools[:n]

internal/server/unified.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func (us *UnifiedServer) callBackendTool(ctx context.Context, serverID, toolName
425425
// This is a server-side guard so agents cannot bypass client-side --allowed-tools
426426
// filters by sending raw tools/call requests directly to the gateway.
427427
if !us.isToolAllowed(serverID, toolName) {
428-
logger.LogWarn("auth", "tools/call denied: tool=%q not in allowed-tools for session=%s",
428+
logger.LogWarn("client", "tools/call denied: tool=%q not in allowed-tools for session=%s",
429429
toolName, auth.TruncateSessionID(sessionID))
430430
httpStatusCode = 403
431431
deniedErr := fmt.Errorf("tool %q is not in the allowed-tools list for this session", toolName)

0 commit comments

Comments
 (0)