Purpose
Draft a new MSX forecast comment for one or more opportunities. Match the exact style, voice, and structure already used on that deal's comment history. Enrich with recent signals from WorkIQ, M365 email/calendar, and optional user-provided notes. Always preview the draft before writing to MSX.
Step 0 — Resolve user identity (run once per session)
Call m365_get_my_profile to get the current user's givenName and surname. Derive initials as the first letter of each (e.g., "Jane Smith" → JS). Use these initials throughout all comment drafts. If the profile call fails, ask the user for their initials before proceeding.
Comment Format Reference
All MSX forecast comments follow:
[Initials] - [D/Mon] - [Narrative]
- Initials: derived from the user's M365 profile (see Step 0)
- Date: single-digit day + three-letter month, no year (e.g.,
2/Jun,15/Oct) — match this exactly - Multiple entries: newest on top, separated by newlines. Never modify or delete prior entries.
Style archetypes — detect which applies to the deal from its comment history and match it:
| Archetype | When to use | Example |
|---|---|---|
| Placeholder | No active engagement yet | JS - 2/Jun - Placeholder for Commercial Modernization |
| Short status | In-flight, status is well-known | JS - 2/Jun - Reservations or JS - 2/Jun - Go forward |
| Structured | Active deal with defined status + clear next action | JS - 2/Jun -\nStatus: [what's happening now]\nNext Action\n[specific action with owner/date] |
| Narrative paragraph | Complex deal; context needed for management review | JS - 2/Jun - [2–4 sentence paragraph: customer situation, pain point, solution fit, current state, next step] |
When in doubt, prefer Structured or Narrative paragraph — they provide the most value for management review.
Workflow
Step 1 — Select opportunity
If the user named an account or opportunity, use msx-mcp-search_opportunities or msx-mcp-get_account_overview to find the MSX ID.
If no specific deal is named, call msx-mcp-get_my_deals and display a numbered list. Ask the user to pick. Support "all my deals" to loop through each one.
Step 2 — Load opportunity details and comment history
Call msx-mcp-get_opportunity_details for the selected opportunity. Extract:
- Account name, sales stage, close date, sales play / solution area
- Full existing forecast comment history (msp_forecastcomments)
Analyze the comment history: - Identify the dominant style archetype - Note typical comment length and tone - Identify recurring phrases and structural patterns - Note whose initials already appear — if they differ from the current user, note that this is an SE adding their own entry alongside the AE's
Step 3 — Gather context signals (run in parallel)
3a. WorkIQ — recent account activity (last 14 days) Resolve the WorkIQ binary path dynamically:
$workiq = "$env:USERPROFILE\.copilot\bin\workiq.cmd"
& $workiq ask -q "What are the latest emails, meetings, and key updates in the last 14 days for [Account Name]? Include deal status, blockers, next steps, and any commitments made."
3b. M365 Email — recent threads
Call m365_search_emails with the account name as the query, limit 10, last 14 days. Look for: status updates, blockers, scheduling, commitments, partner involvement.
3c. M365 Calendar — recent meetings
Call m365_list_events for the past 14 days and filter for the account name in the subject. Note: meeting titles, dates, attendees, any outcomes visible in the body.
3d. MCAPS IQ (optional paste-in) After gathering the above, ask:
"Do you have any MCAPS IQ intel to add? (market signals, competitive notes, opportunity scoring) — paste it here or say 'skip'." If the user provides content, incorporate it as supporting context.
3e. OneNote / additional notes (optional paste-in) After 3d, ask:
"Any additional notes to include? (OneNote, meeting notes, customer emails not in Outlook) — paste them here or say 'skip'." If the user provides content, incorporate it as supporting context.
Step 4 — Synthesize and draft
Using everything gathered, draft the forecast comment:
- Prefix:
[Initials] - [D/Mon] -using the initials from Step 0 and today's date - Apply the detected style archetype for this deal
- Content priorities (use what's most relevant given the deal stage): - Current deal status / where things stand - Key customer context or pain point (Narrative style) - Blocker or dependency (legal, budget, approval, partner) - Recent milestone or customer interaction - Clear next action with owner and date if known
- Tone: professional, direct, deal-focused. No filler phrases. No bullet points unless using the Structured archetype's "Next Action" section.
- Length: match existing entries — if prior comments are 1–2 sentences, stay there; if paragraphs, write a paragraph.
- Preserve existing entries: the new comment is PREPENDED only.
Step 5 — Preview and approval
Present the draft:
=== DRAFT FORECAST COMMENT ===
Opportunity: [Name] ([MSX ID])
Account: [Account Name]
Sales Stage: [Stage]
[New comment text — new entry only]
=== EXISTING COMMENTS (preserved below) ===
[Last 2–3 existing entries, truncated if long]
Then ask the user: - Edit — revise before writing - Write to MSX — patch the opportunity with the new comment prepended - Copy to clipboard only — show paste-ready text, do not write to MSX - Skip — move to the next deal if doing multiple
Step 6 — Write to MSX (only on explicit approval)
If the user approves writing:
- Build the updated field value:
[New comment]\n[Existing msp_forecastcomments content] - Call
msx-mcp-dataverse_write: -entity_set:opportunities-operation:patch-id: [opportunity GUID] -data:{ "msp_forecastcomments": "[new entry]\n[existing]" } - Confirm success and report the MSX ID.
If the Dataverse write fails or the user prefers not to write directly, offer paste-ready text for manual entry.
Multi-deal mode ("all my deals")
If the user says "update all my deals" or "run through all my opportunities":
1. Call msx-mcp-get_my_deals to get the full list
2. Skip deals where the most recent comment is already dated today
3. For each remaining deal, run Steps 2–5 sequentially
4. Ask whether to write each one before moving to the next
5. At the end, summarize: deals updated, deals skipped, deals needing attention
Guardrails
- Never write to MSX without explicit user approval — always preview first
- Never invent facts — if there's no context signal for a deal, say so and offer a placeholder draft instead
- Never modify existing comments — only prepend new ones
- Never include internal Microsoft strategy, pricing details, or HR data in the comment text
- If WorkIQ or email search returns no results, note it and offer to draft from MSX history only
- If the user's initials should differ (e.g., writing on behalf of someone), ask before proceeding
Failure handling
- No deals found: offer to search by account name or MSX ID
- WorkIQ not found / timeout: proceed without it, note the gap
- No recent signals found: offer a placeholder comment or ask user to provide context verbally
- Dataverse write error: show paste-ready text as fallback
- Ambiguous account match: show candidates and ask user to confirm
Output contract
Return per opportunity: 1. Draft comment text (new entry only) 2. Full updated comments field (new + existing) for review 3. Signal summary (what sources informed the draft) 4. Approval action selected 5. Write confirmation or paste-ready text