refactor(mcp): remove redundant entry-level logs and cross-reference list* methods#7384
Merged
Merged
Conversation
… to list* methods The listTools, listResources, and listPrompts functions each had a per-function log statement that duplicated the logging already performed inside listMCPItems (in pagination.go). Remove the redundant log calls and add Godoc cross-reference comments to document the intentional parallel structure of the three functions. Closes #7361
Copilot
AI
changed the title
[WIP] Refactor duplicate code in listTools, listResources, and listPrompts
refactor(mcp): remove redundant entry-level logs and cross-reference list* methods
Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors MCP connection list operations to reduce redundant logging and clarify intentional parallel structure among the list* methods that fetch paginated data via the SDK.
Changes:
- Removed per-function entry logs from
listTools,listResources, andlistPrompts, relying on the centralized logging inlistMCPItemsafter session validation. - Added GoDoc cross-reference comments documenting that
listTools,listResources, andlistPromptsintentionally share the same structure.
Show a summary per file
| File | Description |
|---|---|
| internal/mcp/connection_methods.go | Removes redundant list-entry logs and adds GoDoc “See also” cross-references for the parallel list methods. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
listTools,listResources, andlistPromptseach fired alogConn.Printfentry log that duplicated the logging already emitted bylistMCPItemsafter session validation. The three functions were also undocumented as intentionally parallel, creating a silent maintenance contract.Changes
internal/mcp/connection_methods.gologConn.PrintffromlistTools,listResources, andlistPrompts— equivalent logging continues insidelistMCPItems("list%s: requesting %s list from backend serverID=%s")