Simplify Next.js server discovery by combining server and tool listing #96
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.
The old
nextjs_runtimetool required multiple roundtrips to get started. You'd calldiscover_serversto find running servers, then calllist_toolsseparately to see what each server offers. This meant two separate tool invocations just to figure out what's available before you could actually do anything useful.This felt clunky in practice. When you're trying to debug a Next.js app, you just want to know "what servers are running and what can I do with them?" Having to make two separate calls to answer that question added unnecessary friction.
The new approach combines these into a single
nextjs_indexcall that returns everything at once - all running servers with their full tool listings. One call gives you the complete picture of what's available.This changes the workflow from:
nextjs_runtimewithaction: "discover_servers"nextjs_runtimewithaction: "list_tools"for each servernextjs_runtimewithaction: "call_tool"to actually do somethingTo just:
nextjs_index(gets servers + tools in one shot)nextjs_callwith the specific tool you wantAs a side effect, splitting this into two separate tools (
nextjs_indexandnextjs_call) also makes the API clearer since you're not passing around action discriminators and conditionally-required parameters. But the main win is cutting out that extra roundtrip during discovery.