Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Summary

Follow-up cleanup to PR #1797: simplifies NewServerToolWithRawContextHandler to NewServerTool now that it's the only raw handler constructor.

Why

After removing NewServerToolFromHandler, the verbose name NewServerToolWithRawContextHandler is unnecessarily long. This PR simplifies the API surface.

What changed

  • Renamed deprecated generic NewServerTool[In, Out]NewServerToolWithDeps[In, Out] (resolves naming conflict, preserves dynamic tools usage)
  • Renamed NewServerToolWithRawContextHandlerNewServerTool
  • Updated all call sites in dependencies.go, registry_test.go, and dynamic_tools.go
  • Clarified documentation: NewServerToolWithDeps is for special cases only (e.g., DynamicToolDependencies)

MCP impact

  • No tool or API changes
    Internal refactor only—no changes to MCP tool definitions or runtime behavior.

Prompts tested (tool changes only)

N/A

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
    Internal function rename—no user-facing documentation required.
Original prompt

Now that PR #1797 has removed the deprecated NewServerToolFromHandler function, the remaining function NewServerToolWithRawContextHandler has an unnecessarily verbose name.

Since it's now the only way to create a server tool, rename it to the simpler NewServerTool.

Tasks:

  1. Rename NewServerToolWithRawContextHandler to NewServerTool in pkg/inventory/server_tool.go
  2. Update all call sites across the codebase to use the new name
  3. Update any documentation or comments that reference the old name
  4. Run script/lint and script/test to ensure everything passes

This is a follow-up cleanup to PR #1797 and should be stacked on top of it (base branch: copilot/remove-old-server-tool-function).


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Renamed deprecated NewServerTool[In, Out] to NewServerToolWithDeps[In, Out]
- Updated dynamic_tools.go to use NewServerToolWithDeps (for special case with DynamicToolDependencies)
- Renamed NewServerToolWithRawContextHandler to NewServerTool
- Updated all call sites in dependencies.go and registry_test.go
- All tests pass, linter passes

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot AI changed the title [WIP] Rename NewServerToolWithRawContextHandler to NewServerTool Rename NewServerToolWithRawContextHandler to NewServerTool Jan 12, 2026
Copilot AI requested a review from SamMorrowDrums January 12, 2026 22:16
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