Skip to main content
Community Maintained - This SDK is functional but receives limited maintenance. For production use, we recommend the TypeScript SDK or Python SDK.

Creating Tools

Define tools that execute on the client side:

Schema Builder

The fluent schema builder creates JSON Schema for tool inputs:

Schema Methods

Tool Results

Text Result

Error Result

Image Result

Resource Result

MCP Servers

Client Tools Server

Create an MCP server with client-side tools:

Stdio Server

Connect to an MCP server via stdio:

SSE Server

Connect to an MCP server via Server-Sent Events:

HTTP Server

Connect to an MCP server via HTTP:

Using Tools in Sessions

Full Example

Tool Execution Flow

  1. Claude decides to use a tool
  2. Server sends tool_call message to client
  3. Client executes the tool handler locally
  4. Client sends tool_result back to server
  5. Claude processes the result and continues
The executeIn: "client" flag is automatically set for tools with handlers, ensuring they execute locally.