Repository navigation
feat(web): show tool/prompt/resource counts in list headers and Connection Info - #2708
Merged
Merged
Conversation
…ction Info (#2607) The Tools and Prompts list headers now read "Tools (N)" / "Prompts (N)", and Connection Info's Server Capabilities column shows the same count beside Tools, Prompts and Resources. Server authors need this to check clients that cap tools per server; until now the only way was the CLI piped through jq. The count is the server's loaded total, not the search-filtered view. In paginated mode with a nextCursor still unloaded it renders as a lower bound ("10+") so a partial count never reads as the total, and it is omitted after a failed load, where "(0)" would read as an empty server. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
2 tasks done
There was a problem hiding this comment.
🟡 Changes recommended
Pending initial list requests are incorrectly displayed as complete zero counts.
3 open findings
What changed in this PR
Adds loaded tool, prompt, and resource counts to web list headers and Connection Info for issue #2607.
Changes:
- Adds shared complete/partial count formatting.
- Displays counts in list headers and supported server capabilities.
- Adds unit and Storybook coverage; call-history work remains in #2705.
| File | Description |
|---|---|
clients/web/src/utils/listCount.ts |
Adds count derivation and formatting helpers. |
clients/web/src/utils/listCount.test.ts |
Tests count formatting and errors. |
clients/web/src/App.tsx |
Supplies list counts to Connection Info. |
clients/web/src/components/views/InspectorView/InspectorView.test.tsx |
Updates the prompt-heading expectation. |
clients/web/src/components/groups/ToolControls/ToolControls.tsx |
Adds the tools header count. |
clients/web/src/components/groups/ToolControls/ToolControls.test.tsx |
Tests tool count states. |
clients/web/src/components/groups/PromptControls/PromptControls.tsx |
Adds the prompts header count. |
clients/web/src/components/groups/PromptControls/PromptControls.test.tsx |
Tests prompt count states. |
clients/web/src/components/groups/ConnectionInfoModal/ConnectionInfoModal.tsx |
Forwards capability counts. |
clients/web/src/components/groups/ConnectionInfoModal/ConnectionInfoModal.test.tsx |
Tests count forwarding. |
clients/web/src/components/groups/ConnectionInfoContent/ConnectionInfoContent.tsx |
Renders supported capability counts. |
clients/web/src/components/groups/ConnectionInfoContent/ConnectionInfoContent.test.tsx |
Tests capability count behavior. |
clients/web/src/components/elements/CapabilityItem/CapabilityItem.tsx |
Supports partial count labels. |
clients/web/src/components/elements/CapabilityItem/CapabilityItem.test.tsx |
Tests partial count rendering. |
clients/web/src/components/elements/CapabilityItem/CapabilityItem.stories.tsx |
Adds a partial-count story. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Before the connect-time list request returned, the list was [] with no error and no next page, so the headers and Connection Info briefly read "Tools (0)" as a complete total (Copilot review on #2708). ManagedListState now tracks whether a fetch has committed a list this connection (isLoaded), set and cleared just before its *Change dispatch, and useManagedTools/Prompts/Resources expose it as `loaded`. usePaginatedList selects the active source's loaded state (page 1 landed in paginated mode, the aggregate otherwise), and listCountOf returns no count until it is true. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
Member
Author
|
Copilot round 1: 3 findings, all the same defect, all fixed in 3dffa7f.
Requesting another round. |
Member
Author
|
Copilot review closed. Round 2 was clean: 0 inline comments, 0 open findings, and all 3 round-1 findings resolved. The loop stops on the first clean round. |
2 tasks done
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.

Closes #2607
What
The web UI now shows how many tools, prompts and resources a server exposes. Before this, the CLI piped through
jqwas the only way to get the number, and server authors need it to check clients that cap tools per server.Tools (N)andPrompts (N).✓ Tools (N),✓ Resources (N)and✓ Prompts (N). This uses thecountprop thatCapabilityItemalready had perspecification/v2_ux_interfaces.mdbut nothing ever passed.How the count behaves:
nextCursorto load, the count reads4+.Tools, because(0)would read as an empty server.The formatting is one pure helper,
clients/web/src/utils/listCount.ts. The headers,CapabilityItemandAppall go through it.Scope
URIs (N)andTemplates (N), so a header count would repeat the URIs number.Screenshots
All taken against
test-servers/configs/pagination-http.json: 12 tools, prompts and resources, 4 per page.Connection Info: counts beside each list-backed capability

Tools tab:

Tools (12), all pages aggregatedTools tab, Paginated on: page 1 loaded, so the count is a lower bound,

Tools (4+)Prompts tab:

Prompts (12)Tests
listCount.test.ts: formatting, the+lower bound, and no count after a failed load.ToolControls/PromptControls: the header counts the full list under a search, showsN+while more pages remain, and omits the count after a load error.CapabilityItem: the partial count. A newSupportedWithPartialCountstory covers it too.ConnectionInfoContent: counts render beside supported list capabilities only.ConnectionInfoModal: the counts are forwarded.npm run local:gatepasses.🤖 Generated with Claude Code