SDK Tools

Call Lumail V2 tools from server-side TypeScript code through the SDK.

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

ScenarioUse SDK tools?
Your backend needs a generic action runnerYes
You want to expose selected Lumail actions in an admin UIYes
You are writing TypeScript automation scriptsYes
You are connecting Claude or Cursor directlyUse MCP
You need Python, Ruby, Go, or PHPUse the REST Tools API