Skip to main content
Glama

messages_compose

Create a one-off message to a lead outside any campaign. Accepts plain text or template syntax (${field}, {{prompt}}, {opt1|opt2}). Templates are resolved against the lead's context before saving. Specify send_now: true to schedule for immediate delivery, or scheduled_at for a future time; otherwise the message is saved as a draft (status=NEW). The lead goes through the same compliance checks as campaign messages: a blocked lead returns 409 (code: compliance_blocked) before anything is generated or charged. When replying (in_reply_to_message_sqid), quote_previous: true appends the replied-to message below the body as a > -quoted block, the same way threaded sequence steps quote the step before them.

Recipient. By default the message goes to the lead's contact. When replying to an inbound message it goes to the address that message came from instead (the person who actually wrote back may be a colleague or use another address); replying to one of our own sends keeps that send's recipient. Pass email_to to choose the address explicitly. The response's email_to is empty when the lead's contact is used.

Content lint (compliance gate content_lint): unless the message replies to in_reply_to_message_sqid, a subject starting with Re:/Fwd: (AW:, TR:, RV:…) or quoted email history ("On … wrote:") is deceptive; so is a mailbox display name using another brand (Google, PayPal, a bank…). In enforce mode that is 400 code: "content_lint" with issues; in warn mode the message is created and the response carries warnings.

Footer (include_footer): whether the message ends with the footer — company name, postal address, unsubscribe line — and carries the List-Unsubscribe headers. Default: off when the message replies to an incoming message (in_reply_to_message_sqid of a message the lead sent: personal correspondence), on otherwise. The text is the default footer template (codedoc/compliance.md). Sending a new (non-reply) message without the footer is allowed but recorded as a compliance warning (gate footer, reason footer_disabled); anti-spam laws require an opt-out and the sender's identity in most countries.

Method: POST /api/v1/workspaces/{workspace_sqid}/messages/compose/

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "body": "<body>",
      "lead_sqid": "<lead_sqid>",
      "mailbox_sqid": "<mailbox_sqid>",
      "subject": "<subject>"
    },
    "name": "messages_compose"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
subjectYes
email_toNoRecipient address. Omit to use the default: the sender of the replied-to inbound message, else the lead's contact.
send_nowNo
lead_sqidYes
mailbox_sqidYes
scheduled_atNo
include_footerNoAdd the footer (unsubscribe & company details) and List-Unsubscribe headers. Omit for the default: off for a reply to an incoming message, on otherwise.
quote_previousNo
in_reply_to_message_sqidNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

With zero annotations, the description carries the full behavioral burden and does so unusually well: compliance checks return 409 `compliance_blocked` before generation or charging, content_lint distinguish enforce vs warn modes with 400/`issues` vs `warnings`, footer defaults flip based on reply-to-inbound status and record a `footer_disabled` warning. It also discloses recipient-resolution rules and the empty `email_to` in the response.

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

Conciseness4/5

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

The definition is long but front-loaded and organized with bold section headers (Recipient, Content lint, Footer), and it ends with the HTTP method. Given 10 parameters and no annotations, nearly every sentence carries operational weight, though the lint and footer paragraphs are dense enough to be worth trimming slightly.

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

Completeness4/5

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

There is no output schema, and the description partially compensates by describing error payloads (`code`, `issues`, `warnings`, `email_to`) rather than the full success response shape. For a mutation tool with no annotations, it covers the failure modes an agent must handle, with the main omission being the pending/draft response structure and the role of `mailbox_sqid`.

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

Parameters4/5

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

Schema description coverage is only 20%, so the description must compensate, and it mostly does — template syntax for `body`, draft/send semantics for `send_now` and `scheduled_at`, reply quoting for `quote_previous`, footer defaults, and explicit recipient overrides for `email_to`. `mailbox_sqid` and `lead_sqid` receive no explanation at all, leaving a real gap for a required 10-param tool.

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 first sentence gives a precise verb, resource, and scope: 'Create a one-off message to a lead outside any campaign.' That scope phrase implicitly separates it from the campaign-generation path, but no sibling tool is named explicitly, so differentiation stops short of the top band.

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

Usage Guidelines3/5

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

The description richly explains how to choose among send_now, scheduled_at, and the draft default, and when the reply path applies, but it never tells the agent when to pick this tool over messages_create, messages_preview, or campaigns_generate_messages. Usage is implied through behavior rather than stated as tool-selection guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.