Conversation
- CreateReplyInputSchema with Zod validation (conversationId, text, customer, draft, cc/bcc, status) - replySpacing (relaxed/compact) and allowSendReply config options - postWithResponse method on HelpScoutClient to capture Resource-Id header - Updated .env.example with HELPSCOUT_REPLY_SPACING and HELPSCOUT_ALLOW_SEND_REPLY
- Draft by default; HELPSCOUT_ALLOW_SEND_REPLY=true required to send - formatReplyHtml transforms HTML for Help Scout's native editor: - <p> → <br><br>, <pre> → <div> with newlines as <br> - Inline <code> gets class="inline-code" (existing classes preserved) - Block element spacing normalized (relaxed/compact via env var) - API constraint validation for conversationId, text, customer
14 new tests covering: - Draft/published reply creation and safety controls - Optional fields (cc, bcc, status, user, assignTo) - API constraint validation (invalid ID, missing fields) - HTML formatting: <p> conversion, <code> class injection, <pre> → <div>, list/blockquote spacing (relaxed + compact)
Complete conversation lifecycle: create tickets, fetch by ID, and update
status/assignee/tags/custom fields. Uses correct Help Scout API formats:
- JSONPatch for PATCH /conversations/{id}
- PUT for /conversations/{id}/tags and /conversations/{id}/fields
- Resource-Id header extraction for POST responses
- Zod validation, slim/verbose responses, cache invalidation
15 new tests covering getConversation, createConversation, and updateConversation including JSONPatch format, PUT for tags/fields, Resource-Id header handling, and input validation via api-constraints.
- Add getConversation, createConversation, updateConversation to README tool table with usage examples - Add 3 tools to MCPB manifest.json - Copy Help Scout API reference from MonoKit with corrections: Update Conversation uses JSONPatch (not flat JSON), tags via PUT, custom fields via PUT, embed only supports 'threads'
createDocsArticleAsset, uploadDocsArticle, and createDocsSettingsAsset were sending JSON instead of multipart/form-data, which the Help Scout Docs API requires for file uploads. Added articleId as a required param for article assets. Added postFormData method to the docs client. Added form-data as a direct dependency.
LLMs typically output \n instead of HTML tags. Strip newlines after block-level closing tags (formatting whitespace), convert double \n to paragraph breaks, and single \n to <br>.
Why: Help Scout API returns article text wrapped in <![CDATA[...]]> which was passed through to callers, causing ]]> to appear literally at the end of article content - Add stripCdata() helper to remove CDATA wrapper from API responses - Apply to getDocsArticle (verbose and slim modes) and search result previews - Does not affect text sent TO the API (create/update operations)
Why: Help Scout AI drafts show the mailbox owner's name in createdBy, causing AI agents to falsely attribute them as real staff replies. - Add excludeDrafts param to getThreads (default: true) - Filter state=draft and source.type=support-agent-ai in all formats - Add support-agent-ai filter to buildTranscript - Include draftsExcluded flag in all output formats - Update README with excludeDrafts documentation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughAdds four new Help Scout tools (createReply, getConversation, createConversation, updateConversation), new input schemas and validations, client methods for POST/PATCH/PUT and multipart uploads, config flags for reply spacing and publish permission, docs updates, and expanded tests. Changes
Sequence Diagram(s)sequenceDiagram
participant User as Client
participant TH as ToolHandler
participant CFG as Config
participant HS as HelpScoutClient
participant API as HelpScout API
User->>TH: call createReply(args)
TH->>CFG: read replySpacing & allowSendReply
TH->>TH: formatReplyHtml(args.html, replySpacing)
TH->>HS: postWithResponse("/conversations/{id}/threads", {type: "reply", ...})
HS->>API: POST /conversations/{id}/threads
API-->>HS: 201 Created (thread/draft id)
HS-->>TH: {status, headers, data}
TH->>TH: if published -> patch conversation status (guarded by allowSendReply)
TH-->>User: return created reply metadata (draft/published)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
- Default excludes AI drafts (source.type: support-agent-ai) and unsent drafts (state: draft) - excludeDrafts:false includes all threads - Transcript format excludes drafts - Verbose format excludes drafts - Inline transcripts via searchConversations exclude drafts
jgalea
pushed a commit
to jgalea/help-scout-mcp
that referenced
this pull request
Apr 25, 2026
feat: excludeDrafts param for getThreads (v2.2.1)
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
excludeDraftsparameter togetThreads(default:true) — filters AI-generated drafts (source.type: "support-agent-ai") and unsent drafts (state: "draft") from resultssupport-agent-aifilter tobuildTranscript(inline transcripts viasearchConversations)draftsExcluded: trueflag in all three output formats (transcript, verbose, slim)excludeDrafts: falseto include all threads including AI draftsWhy: Help Scout assigns AI drafts to the mailbox owner's name in
createdBy, causing AI agents to falsely attribute them as real staff replies.Test plan
getThreadswith default params excludes AI drafts and unsent draftsgetThreadswithexcludeDrafts: falsereturns all threadssearchConversationsexclude draftsnpm run buildSummary by CodeRabbit
New Features
Documentation
Chores