Skip to main content
Glama

outreach.draft

Read-only

Generate a platform-specific outreach draft for a lead by analyzing their post and selecting the right engagement action—comment, reply, or DM—to produce a tailored message ready to paste.

Instructions

Generate a platform-tuned outreach message for a specific lead the user wants to engage. Behavior: hits the draft-outreach edge function which uses an LLM with platform-specific tone profiles (Reddit paragraph, X 280-char reply, YouTube comment, TikTok DM, Instagram caption). Persists nothing. Consumes one credit per draft. Each call is independent; the drafter does not remember previous drafts. Usage: call this once per lead the user picked from a leads.find result. Pick the right outreach_action for the situation: 'comment_post' for a top-level reply on a thread, 'reply_comment' to respond to a specific comment (provide reply_to_author + reply_to_text), 'dm' or 'dm_post_author' for a DM, 'channel_about' for a YouTube About-tab cold intro, 'profile_check' for stale posts where you want a follow-up rather than a direct reply. Do NOT call outreach.draft for COMPETITOR-flagged leads (their matched_signals contains 'category:COMPETITOR') as outreach to a competitor's content is bad form. Do NOT use it to write generic copy unrelated to a specific post. Returns: { draft } as a single string ready to paste, no surrounding chrome.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ideaYesThe refined product idea (used as the writer's voice)
sourceYesWhich platform the lead is on
outreach_actionYesHow to engage. dm/dm_post_author for DMs, comment_post for top-level comments, reply_comment to respond to a specific thread comment, channel_about for YouTube About-tab contact, profile_check for stale posts.
post_titleYesTitle of the lead post
post_bodyYesBody / snippet of the lead post
post_handleNoOP handle (e.g. 'u/founder', '@user'). Optional but improves drafts.
languageNoOutput language. Defaults to 'en'.
reply_to_authorNoFor reply_comment: the author of the comment being replied to.
reply_to_textNoFor reply_comment: the comment text being replied to.

Implementation Reference

  • Zod schema defining the input parameters for outreach.draft: idea, source (platform enum), outreach_action, post_title, post_body, post_handle, language, reply_to_author, reply_to_text.
    {
      idea: z
        .string()
        .describe("The refined product idea (used as the writer's voice)"),
      source: z
        .enum(["reddit", "x", "twitter", "youtube", "tiktok", "instagram"])
        .describe("Which platform the lead is on"),
      outreach_action: z
        .enum([
          "reply_comment",
          "comment_post",
          "reply",
          "comment",
          "dm",
          "dm_post_author",
          "channel_about",
          "profile_check",
        ])
        .describe(
          "How to engage. dm/dm_post_author for DMs, comment_post for top-level comments, reply_comment to respond to a specific thread comment, channel_about for YouTube About-tab contact, profile_check for stale posts.",
        ),
      post_title: z.string().describe("Title of the lead post"),
      post_body: z.string().describe("Body / snippet of the lead post"),
      post_handle: z
        .string()
        .optional()
        .describe("OP handle (e.g. 'u/founder', '@user'). Optional but improves drafts."),
      language: z
        .enum(["en", "pt"])
        .optional()
        .describe("Output language. Defaults to 'en'."),
      reply_to_author: z
        .string()
        .optional()
        .describe("For reply_comment: the author of the comment being replied to."),
      reply_to_text: z
        .string()
        .optional()
        .describe("For reply_comment: the comment text being replied to."),
    },
  • src/index.ts:629-725 (registration)
    Registration of the 'outreach.draft' tool via server.tool(...) with its description, schema, and metadata hints.
    server.tool(
      "outreach.draft",
      "Generate a platform-tuned outreach message for a specific lead the user wants to engage. Behavior: hits the draft-outreach edge function which uses an LLM with platform-specific tone profiles (Reddit paragraph, X 280-char reply, YouTube comment, TikTok DM, Instagram caption). Persists nothing. Consumes one credit per draft. Each call is independent; the drafter does not remember previous drafts. Usage: call this once per lead the user picked from a leads.find result. Pick the right outreach_action for the situation: 'comment_post' for a top-level reply on a thread, 'reply_comment' to respond to a specific comment (provide reply_to_author + reply_to_text), 'dm' or 'dm_post_author' for a DM, 'channel_about' for a YouTube About-tab cold intro, 'profile_check' for stale posts where you want a follow-up rather than a direct reply. Do NOT call outreach.draft for COMPETITOR-flagged leads (their matched_signals contains 'category:COMPETITOR') as outreach to a competitor's content is bad form. Do NOT use it to write generic copy unrelated to a specific post. Returns: { draft } as a single string ready to paste, no surrounding chrome.",
      {
        idea: z
          .string()
          .describe("The refined product idea (used as the writer's voice)"),
        source: z
          .enum(["reddit", "x", "twitter", "youtube", "tiktok", "instagram"])
          .describe("Which platform the lead is on"),
        outreach_action: z
          .enum([
            "reply_comment",
            "comment_post",
            "reply",
            "comment",
            "dm",
            "dm_post_author",
            "channel_about",
            "profile_check",
          ])
          .describe(
            "How to engage. dm/dm_post_author for DMs, comment_post for top-level comments, reply_comment to respond to a specific thread comment, channel_about for YouTube About-tab contact, profile_check for stale posts.",
          ),
        post_title: z.string().describe("Title of the lead post"),
        post_body: z.string().describe("Body / snippet of the lead post"),
        post_handle: z
          .string()
          .optional()
          .describe("OP handle (e.g. 'u/founder', '@user'). Optional but improves drafts."),
        language: z
          .enum(["en", "pt"])
          .optional()
          .describe("Output language. Defaults to 'en'."),
        reply_to_author: z
          .string()
          .optional()
          .describe("For reply_comment: the author of the comment being replied to."),
        reply_to_text: z
          .string()
          .optional()
          .describe("For reply_comment: the comment text being replied to."),
      },
      {
        title: "Draft outreach",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: true,
      },
      async ({
        idea,
        source,
        outreach_action,
        post_title,
        post_body,
        post_handle,
        language,
        reply_to_author,
        reply_to_text,
      }) => {
        const err = requireKey();
        if (err) return err;
    
        const fallbackLanguage =
          GORILLA_DEFAULT_LANGUAGE === "pt" ? "pt" : "en";
        const body: Record<string, unknown> = {
          idea,
          language: language ?? fallbackLanguage,
          source,
          outreach_action,
          post: {
            title: post_title,
            body: post_body,
            ...(post_handle ? { handle: post_handle } : {}),
          },
        };
        if (reply_to_author && reply_to_text) {
          body.reply_to_comment = { author: reply_to_author, text: reply_to_text };
        }
    
        const { draft } = await call<{ draft: string }>(
          "POST",
          "draft-outreach",
          body,
        );
    
        return {
          content: [
            {
              type: "text" as const,
              text: draft,
            },
          ],
        };
      },
    );
  • Async handler function for outreach.draft: constructs the request body, calls the 'draft-outreach' API endpoint via the call() helper, and returns the draft text.
    async ({
      idea,
      source,
      outreach_action,
      post_title,
      post_body,
      post_handle,
      language,
      reply_to_author,
      reply_to_text,
    }) => {
      const err = requireKey();
      if (err) return err;
    
      const fallbackLanguage =
        GORILLA_DEFAULT_LANGUAGE === "pt" ? "pt" : "en";
      const body: Record<string, unknown> = {
        idea,
        language: language ?? fallbackLanguage,
        source,
        outreach_action,
        post: {
          title: post_title,
          body: post_body,
          ...(post_handle ? { handle: post_handle } : {}),
        },
      };
      if (reply_to_author && reply_to_text) {
        body.reply_to_comment = { author: reply_to_author, text: reply_to_text };
      }
    
      const { draft } = await call<{ draft: string }>(
        "POST",
        "draft-outreach",
        body,
      );
    
      return {
        content: [
          {
            type: "text" as const,
            text: draft,
          },
        ],
      };
    },
  • Generic HTTP call helper used by the handler to POST to the 'draft-outreach' endpoint with auth headers.
    async function call<T>(
      method: "GET" | "POST" | "DELETE",
      endpoint: string,
      body?: unknown
    ): Promise<T> {
      const cfg = await getConfig();
      const res = await fetch(`${cfg.api_base}/${endpoint}`, {
        method,
        headers: {
          "Content-Type": "application/json",
          "x-api-key": GORILLA_API_KEY,
          apikey: cfg.gateway_key,
        },
        ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
      });
    
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(`${method} /${endpoint} failed (${res.status}): ${text}`);
      }
    
      return res.json() as Promise<T>;
    }
  • Configuration of GORILLA_DEFAULT_LANGUAGE used as fallback language in outreach.draft when not provided.
    // Optional: default language used as fallback in idea.refine and outreach.draft
    // when the caller doesn't pass `language`. Accepts "en", "pt", or "all".
    const GORILLA_DEFAULT_LANGUAGE = process.env.GORILLA_DEFAULT_LANGUAGE ?? "";
Behavior5/5

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

Discloses key behaviors beyond annotations: persists nothing, consumes one credit per draft, and each call is independent. No contradiction with readOnlyHint=true or other annotations.

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?

Well-structured and concise: starts with purpose, then behavior, usage, and exclusions. Every sentence is necessary and informative.

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?

Thorough for a complex tool with 9 parameters and no output schema. Covers behavior, side effects, usage patterns, and negative examples. Return format is adequately described.

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 coverage is 100% with good descriptions. The description adds extra context for outreach_action options and clarifies optional parameters like post_handle. However, schema already handles basic semantics.

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?

The description clearly states it generates platform-tuned outreach messages for a specific lead. It distinguishes from sibling tools like outreach.plan and leads.find by specifying the purpose and context.

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

Usage Guidelines5/5

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

Provides explicit usage guidance: call once per lead from leads.find, detailed explanations of outreach_action variants, and negative instructions to avoid COMPETITOR-flagged leads and generic copy.

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/opusforge/gorilla-mcp'

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