Skip to content

feat(web): show tool/prompt/resource counts in list headers and Connection Info - #2708

Merged
cliffhall merged 3 commits into
v2/mainfrom
v2/feat/2607-list-counts
Oct 12, 2026
Merged

cliffhall merged 3 commits into
v2/mainfrom
v2/feat/2607-list-counts

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2607

What

The web UI now shows how many tools, prompts and resources a server exposes. Before this, the CLI piped through jq was the only way to get the number, and server authors need it to check clients that cap tools per server.

  • List headers: Tools (N) and Prompts (N).
  • Connection Info → Server Capabilities: ✓ Tools (N), ✓ Resources (N) and ✓ Prompts (N). This uses the count prop that CapabilityItem already had per specification/v2_ux_interfaces.md but nothing ever passed.

How the count behaves:

  • It is the server's loaded total, not the search-filtered view. The header answers "how many does this server expose".
  • A partial count is never shown as the total. In paginated mode, while the server still has a nextCursor to load, the count reads 4+.
  • No count after a failed load. The header shows just Tools, because (0) would read as an empty server.
  • No count on an unsupported capability (✗).

The formatting is one pure helper, clients/web/src/utils/listCount.ts. The headers, CapabilityItem and App all go through it.

Scope

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
connection-info-counts

Tools tab: Tools (12), all pages aggregated
tools-tab-count

Tools tab, Paginated on: page 1 loaded, so the count is a lower bound, Tools (4+)
tools-tab-partial-count

Prompts tab: Prompts (12)
prompts-tab-count

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, shows N+ while more pages remain, and omits the count after a load error.
  • CapabilityItem: the partial count. A new SupportedWithPartialCount story covers it too.
  • ConnectionInfoContent: counts render beside supported list capabilities only. ConnectionInfoModal: the counts are forwarded.
  • npm run local:gate passes.

🤖 Generated with Claude Code

cliffhall and others added 2 commits October 12, 2026 16:45
…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]>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 12, 2026
@cliffhall cliffhall linked an issue Oct 12, 2026 that may be closed by this pull request
2 tasks done
@cliffhall
cliffhall requested a balanced review from Copilot October 12, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Comment thread clients/web/src/utils/listCount.ts Resolved
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]>
@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 1: 3 findings, all the same defect, all fixed in 3dffa7f.

  • Tools header, Prompts header, listCountOf: before the first list request returned, the empty list read as a complete (0). Counts are now withheld until the active list source has committed a list. That needed a loaded signal from core (ManagedListState.isLoaded() → useManaged* → usePaginatedList). Replied in each thread.

Requesting another round.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The loaded-state handling, pagination semantics, error behavior, wiring, and tests are consistent with the stated requirements.

0 open findings

3 resolved since last review

🧠 Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
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.

@cliffhall
cliffhall merged commit 8fb3b4e into v2/main Oct 12, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/feat/2607-list-counts branch October 12, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2] Show tool count and per-tool call/log history in the web UI

2 participants