Skip to content

Conversation

@SamMorrowDrums
Copy link
Collaborator

Summary

Convert GetRepositoryTree to use the NewTool pattern with ToolDependencies, removing the direct getClient parameter in favor of deps.GetClient.

Changes

  • Converted GetRepositoryTree in git.go to use NewTool pattern
  • Updated git_test.go to use new handler invocation pattern
  • Updated tools.go to use direct function call instead of NewServerToolLegacy wrapper
  • Removed duplicate test Test_RepositoriesGetRepositoryTree from repositories_test.go (canonical test is in git_test.go)

Stack

This PR is part of a stacked PR series to eliminate all NewServerToolLegacy usages:

Testing

  • All existing tests pass
  • Linting passes

@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner December 13, 2025 17:28
Copilot AI review requested due to automatic review settings December 13, 2025 17:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the GetRepositoryTree tool to use the NewTool pattern with ToolDependencies, eliminating another usage of the deprecated NewServerToolLegacy wrapper. This is part of a systematic refactoring across the codebase to standardize dependency injection for MCP tools.

Key changes:

  • Converted GetRepositoryTree from returning separate tool and handler to returning toolsets.ServerTool
  • Replaced direct getClient parameter with deps.GetClient for dependency injection
  • Removed duplicate test from repositories_test.go (canonical test remains in git_test.go)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/github/git.go Refactored GetRepositoryTree to use NewTool pattern with ToolDependencies, replacing direct getClient parameter with deps.GetClient
pkg/github/git_test.go Updated test to use new handler invocation pattern with ToolDependencies struct and toolDef.Handler(deps)
pkg/github/tools.go Changed from NewServerToolLegacy wrapper to direct function call for GetRepositoryTree
pkg/github/repositories_test.go Removed duplicate test Test_RepositoriesGetRepositoryTree (canonical version exists in git_test.go)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants