> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# Client

## Methods

### addEventListener

Adds a handler for the specified [MCP.ServerEvents](/api-reference/voxengine/mcp/server-events) or [MCP.Events](/api-reference/voxengine/mcp/events) event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

```ts
addEventListener(event: MCP.Events | MCP.ServerEvents | T, callback: (event: MCP._ClientEvents[T]) => any): void
```

**Parameters**

### callTool

Call a tool from the MCP server. [https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0/mcp#CallToolParams](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0/mcp#CallToolParams)

```ts
callTool(parameters: Object): void
```

**Parameters**

### close

Closes the connection (over WebSocket) or connection attempt.

```ts
close(): void
```

### id

Returns the Client id.

```ts
id(): string
```

### listTools

List the tools available from the MCP server. [https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0/mcp#ListToolsParams](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0/mcp#ListToolsParams)

```ts
listTools(parameters: Object): void
```

**Parameters**

### removeEventListener

Removes a handler for the specified [MCP.ServerEvents](/api-reference/voxengine/mcp/server-events) or [MCP.Events](/api-reference/voxengine/mcp/events) event.

```ts
removeEventListener(event: MCP.Events | MCP.ServerEvents | T, callback?: (event: MCP._ClientEvents[T]) => any): void
```

**Parameters**

### webSocketId

Returns the WebSocket id.

```ts
webSocketId(): string
```