The SDK can list, inspect, and run Lumail tools through the V2 tools API.

This is useful when your app wants one generic tool interface for actions like dashboard stats, subscriber search, campaign operations, or AI-assisted copy improvements. It is still a normal API call from your application. For direct assistant integrations, use [MCP](/docs/ai-integration/mcp-claude).

## List Tools

```typescript
const { tools, grouped } = await lumail.tools.list();

console.log(tools.length);
console.log(Object.keys(grouped));
```

## Get a Tool Schema

```typescript
const { tool } = await lumail.tools.get("list_subscribers");

console.log(tool.inputSchema);
```

## Run a Tool

```typescript
const result = await lumail.tools.run<{ subscribers: unknown[] }>(
  "list_subscribers",
  {
    limit: 10,
    status: "SUBSCRIBED",
  },
);
```

## When to Use SDK Tools

| Scenario                                                  | Use SDK tools?         |
| --------------------------------------------------------- | ---------------------- |
| Your backend needs a generic action runner                | Yes                    |
| You want to expose selected Lumail actions in an admin UI | Yes                    |
| You are writing TypeScript automation scripts             | Yes                    |
| You are connecting Claude or Cursor directly              | Use MCP                |
| You need Python, Ruby, Go, or PHP                         | Use the REST Tools API |

## Related

- [Tools API](/docs/ai-integration/tools-api)
- [V2 Tools Reference](/docs/api-reference/v2-tools)
- [MCP for Claude](/docs/ai-integration/mcp-claude)
