SDK Tools
List, inspect, and run Lumail tools from server-side TypeScript with the SDK. Learn when a generic tool runner fits your backend and when to use MCP.
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.
List Tools
const { tools, grouped } = await lumail.tools.list();
console.log(tools.length);
console.log(Object.keys(grouped));Get a Tool Schema
const { tool } = await lumail.tools.get("list_subscribers");
console.log(tool.inputSchema);Run a Tool
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 |