Skip to content

Previously loaded items discarded when loading paginated prompts or tools #97

Open
@heuperman

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:

  1. Run inspector
  2. Connect to a server that returns paginated tools or prompts in response
  3. Click List Prompts (or List Tools) button
  4. 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.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions