Previously loaded items discarded when loading paginated prompts or tools #97
Description
Describe the bug
When loading additional items from a paginated response using the "List More Prompts" or "List More Tools" buttons all previously loaded prompts or tools are discarded and only the newly loaded items are shown in the pane.
The "List More Resources" and "List More Templates" buttons add additional items to the existing list as expected.
To Reproduce
Steps to reproduce the behavior:
- Run inspector
- Connect to a server that returns paginated tools or prompts in response
- Click List Prompts (or List Tools) button
- List More Prompts or (List More Prompts) button
Expected behavior
Additional prompts are added to list of previously loaded prompts.
Actual behavior
Newly fetched prompts replace previously loaded prompts.
Additional context
This is happening because the listTools
and listPrompts
functions set the state to the newly fetched items instead of concatenating them with the items in the existing state, as listResources
does.