Skip to main content
Glama
izharikov

Sitecore Send

send_transactional_email

Send automated emails to recipients using Sitecore Send's transactional service. This tool delivers personalized messages with custom subjects and HTML content for notifications, confirmations, or alerts.

Instructions

Send an email using transactional email service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesEmail of the recipient
subjectYesSubject of the email
bodyYesHTML body of the email

Implementation Reference

  • The main handler function that sends the transactional email to the specified recipient using the SendClient library. It constructs the email payload with subject, HTML body, and recipient, sends it via the transactional API, and returns success or error message.
    execute: async ({ to, subject, body }) => {
      try {
        const result = await client.transactional.sendEmail({
          Subject: subject,
          CampaignId: transactoinalConfog.campaignId!,
          Personalizations: [
            {
              To: [
                {
                  Email: to,
                }
              ],
            }
          ],
          Content: [
            {
              Value: body,
              Type: "text/html",
            },
          ]
        });
        return {
          content: [
            { type: "text", text: `Email sent ${result.TotalAccepted > 0 ? "successfully" : "unsuccessfully"}` }
          ]
        }
      } catch (e) {
        return {
          content: [
            { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` }
          ]
        }
      }
    }
  • Zod schema for input validation: requires 'to' (email), 'subject' (string), and 'body' (string) parameters.
    parameters: z.object({
      to: z.string().email().describe("Email of the recipient"),
      subject: z.string().describe("Subject of the email"),
      body: z.string().describe("HTML body of the email"),
    }),
  • Registers the 'send_transactional_email' tool on the FastMCP server conditionally if a transactional campaign ID is provided in the config. Includes schema, annotations, and handler.
    if (transactoinalConfog.campaignId) {
      server.addTool({
        name: "send_transactional_email",
        description: "Send an email using transactional email service",
        parameters: z.object({
          to: z.string().email().describe("Email of the recipient"),
          subject: z.string().describe("Subject of the email"),
          body: z.string().describe("HTML body of the email"),
        }),
        annotations: {
          title: "Send an email using transactional email service",
          openWorldHint: true,
        },
        execute: async ({ to, subject, body }) => {
          try {
            const result = await client.transactional.sendEmail({
              Subject: subject,
              CampaignId: transactoinalConfog.campaignId!,
              Personalizations: [
                {
                  To: [
                    {
                      Email: to,
                    }
                  ],
                }
              ],
              Content: [
                {
                  Value: body,
                  Type: "text/html",
                },
              ]
            });
            return {
              content: [
                { type: "text", text: `Email sent ${result.TotalAccepted > 0 ? "successfully" : "unsuccessfully"}` }
              ]
            }
          } catch (e) {
            return {
              content: [
                { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` }
              ]
            }
          }
        }
      });
    }
  • src/tools/index.ts:8-8 (registration)
    Invokes addApiTools within the main addTools function, which registers the send_transactional_email tool among API tools.
    addApiTools(server, config.api, config.transactionalEmails);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide openWorldHint=true, indicating this tool may have side effects or external dependencies. The description adds minimal behavioral context beyond this—it doesn't mention rate limits, authentication needs, error handling, or what 'transactional' implies (e.g., automated vs. marketing emails). However, it doesn't contradict annotations, so it meets the lower bar with annotations present but adds limited value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, and there's no redundancy or fluff, achieving optimal conciseness for this context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of sending emails (which involves external services, potential failures, and side effects), the description is incomplete. With no output schema and only basic annotations, it lacks details on return values, error conditions, or operational constraints. Sibling tools like 'send_smtp_email' suggest alternative methods, but the description doesn't help differentiate or provide context for when this tool is appropriate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for 'to', 'subject', and 'body' parameters. The description adds no additional parameter semantics beyond what the schema already provides—it doesn't explain format expectations, constraints, or examples. This meets the baseline of 3 since the schema does the heavy lifting, but the description doesn't compensate or enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('send') and resource ('email using transactional email service'), making the purpose immediately understandable. It distinguishes from sibling tools like 'send_smtp_email' by specifying 'transactional email service', though it doesn't explicitly contrast with that sibling. The description avoids tautology by adding meaningful context beyond just the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'send_smtp_email' or other email-related siblings. It doesn't mention prerequisites, constraints, or typical use cases for transactional emails versus other types. The agent must infer usage from the name alone, which is insufficient for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/izharikov/send-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server