Overview
Register tools that your app provides to the host. This enables bidirectional tool calling — the host can call tools defined by the app, in addition to the app calling server tools viauseCallServerTool.
Wraps oncalltool · onlisttools
MCP Apps SDK reference
Import
Signature
AppToolsConfig
(params: { name: string; arguments?: Record<string, unknown> }) => CallToolResult | Promise<CallToolResult>
required
Handler called when the host invokes one of this app’s tools. Return a
CallToolResult with the tool’s output.AppTool
Usage
How It Works
- Your app registers tools via
useAppToolswhen the component mounts. - The host discovers tools via the MCP
listtoolsprotocol. - When the host invokes a tool, your
onCallToolhandler is called with the tool name and arguments. - Your handler returns a
CallToolResultwhich the host uses in its next turn.
useAppTools sets onlisttools and oncalltool directly, which replaces the SDK handlers. Its tools are not mirrored into WebMCP, and tools the page registered on WebMCP drop out of tools/list. Use useRegisterTool if you want the bridge.
See Also
useCallServerTool
Call MCP server tools from your app (the other direction).