> ## Documentation Index
> Fetch the complete documentation index at: https://sunpeak.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# useSendToolListChanged

> Notify the host that the app's tool list changed.

<Badge color="yellow">sunpeak API</Badge>

## Overview

Returns a function to notify the host that a custom app-side tool list has changed, so the host runs `tools/list` again.

Do not call this after [`useRegisterTool`](/docs/app-framework/hooks/use-register-tool) operations. The MCP Apps dynamic registry sends the notification automatically after `registerTool()`, `update()`, `enable()`, `disable()`, and `remove()`.

## Import

```tsx theme={null}
import { useSendToolListChanged } from 'sunpeak';
```

## Signature

```tsx theme={null}
function useSendToolListChanged(): () => Promise<void>
```

## Returns

<ResponseField name="sendToolListChanged" type="() => Promise<void>">
  Function that sends a `tools/list_changed` notification to the host.
</ResponseField>

## Usage

```tsx theme={null}
import { useAppTools, useSendToolListChanged } from 'sunpeak';
import { useEffect, useState } from 'react';

function DynamicTools() {
  const [canPing, setCanPing] = useState(false);
  const sendToolListChanged = useSendToolListChanged();

  useAppTools({
    tools: canPing ? [{ name: 'ping', description: 'Return pong.' }] : [],
    onCallTool: async () => ({
      content: [{ type: 'text', text: 'pong' }],
    }),
  });

  useEffect(() => {
    if (canPing) void sendToolListChanged();
  }, [canPing, sendToolListChanged]);

  return <button onClick={() => setCanPing(true)}>Add ping tool</button>;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.