# C#

URL: https://docs.hanzo.ai/docs/zap/bindings/csharp

> ZAP C# SDK - .NET binding with async support

The C# binding provides .NET integration with async/await support.

## Installation

```bash
dotnet add package Zap.Protocol
```

## Quick Start

```csharp
using Zap;

var client = await Zap.ConnectAsync("zap://localhost:9000");

var server = await client.InitAsync(new ClientInfo
{
    Name = "my-agent",
    Version = "1.0.0"
});
Console.WriteLine($"Connected to: {server.Name} v{server.Version}");

var tools = await client.ListToolsAsync();
foreach (var tool in tools)
{
    Console.WriteLine($"  {tool.Name} - {tool.Description}");
}

var result = await client.CallToolAsync(new ToolCall
{
    Id = Guid.NewGuid().ToString(),
    Name = "read_file",
    Args = "{\"path\": \"/etc/hosts\"}"
});

if (result.Error != null)
{
    Console.Error.WriteLine($"Error: {result.Error}");
}
else
{
    Console.WriteLine($"Result: {result.Content}");
}

await client.CloseAsync();
```

## Documentation

Full documentation at [zap-proto/cs](https://github.com/zap-proto/cs).
