mcp-use TypeScript API
    Preparing search index...

    Function useSendFollowUp

    • Returns a callback that sends a follow-up message to the conversation, triggering a model turn.

      Returns (args: { prompt: string }) => Promise<void>

      Requires the host message capability; otherwise the returned promise rejects before any wire traffic. The prompt is delivered to the host as a user-authored chat message, as if the user had typed it. The returned promise resolves when the host accepts the message — not when the model responds; any response arrives through the normal conversation flow (and, if the model calls this view's tool again, through useToolContext). Hosts may require user confirmation or decline the message entirely.

      The returned callback is referentially stable for the lifetime of the mounted runtime.

      function AskAgain() {
      const sendFollowUp = useSendFollowUp();
      return (
      <button
      type="button"
      onClick={() => sendFollowUp({ prompt: "Show more results" })}
      >
      Refine search
      </button>
      );
      }