Skip to main content
Glama

Spam-check and fix a lead's draft

fix_lead_draft_spam
DestructiveIdempotent

The Edit view's Check Spam -> Replace -> Save, for one lead of a SINGLE campaign: spam-checks every email of the lead's draft, applies every suggested fix exactly as the Replace button would, and saves the draft. Returns the score before and after for each email, each replacement made, and the findings that had no one-click fix. Run it after generate_lead_sequence. The lead must be at 'pending_review'. Uses the user's OpenAI key for the check. NOTHING IS SENT.

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": {
      "lead_id": "<lead_id>"
    },
    "name": "fix_lead_draft_spam"
  }
}

Input Schema

NameRequiredDescriptionDefault
lead_idYesThe lead whose draft to fix — the `id` from list_leads. SINGLE campaigns only, and the lead must be at 'pending_review'.
idempotency_keyNoOptional. Send the SAME value when retrying a call you are unsure completed.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag a destructive, idempotent, open-world mutation, and the description adds substantive context beyond them: it saves the draft, mirrors the UI Replace behavior exactly, consumes the user's OpenAI key, and requires a specific lead state. 'NOTHING IS SENT' usefully clarifies the destructiveHint applies to draft content, not outbound email.

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?

Front-loaded with the UI-equivalent action, followed by return contents, then preconditions, cost, and a safety note. Each clause adds distinct information with no filler.

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

Completeness5/5

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

With no output schema, the description compensates by enumerating what comes back (before/after scores, replacements made, unfixed findings). Preconditions, cost, and side effects are all covered for a destructive multi-step tool.

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 coverage is 100%, and the lead_id description already carries the 'id from list_leads', single-campaign and pending_review constraints, so the description largely repeats structured data. idempotency_key semantics are left entirely to the schema.

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

Purpose5/5

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

States a specific composite action ('spam-checks... applies every suggested fix... saves the draft') on a specific resource, scoped to 'one lead of a SINGLE campaign'. The Check Spam -> Replace -> Save framing makes it distinguishable from the plain check_spam sibling.

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

Usage Guidelines4/5

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

Gives an explicit sequencing rule ('Run it after generate_lead_sequence') and a hard precondition ('The lead must be at pending_review'). It doesn't explicitly say when to prefer this over the sibling check_spam, so an agent must infer that this variant is the fix-and-save version.

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.

Resources