mcpField
E
email-recommendation

email-recommendation

github.com/happy-technologies-llc生産性4141 回インストール2 日前に更新
リポジトリ

email-recommendation について

ServiceNow CSM エージェント向けに、ケース情報、メール履歴、ナレッジ記事、顧客の感情、SLA 状況を基に返信案を作成するスキルです。受付確認、進捗、解決、エスカレーションなどの案を生成できます。

主な機能

  1. 01ケース情報とメール履歴の確認
  2. 02顧客の感情と SLA 状況の評価
  3. 03解決策を探すナレッジ検索
  4. 04テンプレートまたは個別返信の作成
  5. 05状況別の返信案の提示

活用シーン

  1. 01新規顧客問い合わせへの返信
  2. 02ケースの進捗連絡
  3. 03解決策のメール共有
  4. 04エスカレーションの顧客通知

MCP 対応

SN-Get-Record、SN-Query-Table、SN-Natural-Language-Search などの ServiceNow MCP ツールを使い、ケース、メール、SLA、ナレッジのデータを取得します。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/happy-technologies-llc/happy-platform-skills --skill email-recommendation

インストール後、Claude Code で/email-recommendationを入力して読み込まれたか確認します。

詳細

メールの推奨文案

概要

このスキルは、カスタマーサービス管理(CSM)ケースに対する、専門的で状況に適したメール返信の下書きを作成します。以下を支援します。

  • 問題の説明、カテゴリ、優先度、現在の状態など、ケースの全体的なコンテキストを分析します
  • 会話の継続性を保つため、メールのやり取りの履歴を確認します
  • ナレッジベースを検索し、関連する解決策や参考資料を探します
  • 以前のやり取りから顧客の感情を把握し、適切なトーンを調整します
  • 適切な構成、共感、解決策の内容を含む、テンプレートまたはカスタムのメール下書きを作成します
  • 状況に応じた複数の返信案を提示します(受領確認、進捗報告、解決、エスカレーション)

使用する場面: CSM エージェントが顧客からの問い合わせに専門的なメールで返信する場合、状況を報告する場合、解決策を伝える場合、またはメールでエスカレーションに対応する場合に使用します。

前提条件

  • ロール: sn_customerservice_agent、sn_customerservice_manager、または csm_admin
  • アクセス権: sn_customerservice_case、sys_email、kb_knowledge、sys_journal_field、customer_account、customer_contact、sn_customerservice_sla テーブルへの読み取りアクセス権
  • 知識: 組織のメールコミュニケーションガイドライン、ブランド基準、CSM ワークフローに関する知識
  • 設定: CSM でメール通知とテンプレートが設定され、送信メールが有効になっていること

手順

ステップ 1:ケースの詳細と現在の状態を取得する

ケースのレコード全体を取得し、顧客からの問い合わせ内容を把握します。

MCP を使用する場合(Claude Code/Desktop):

Tool: SN-Get-Record
Parameters:
  table_name: sn_customerservice_case
  sys_id: [case_sys_id]
  fields: number,short_description,description,state,priority,urgency,impact,category,subcategory,contact,account,consumer,product,asset,assigned_to,assignment_group,opened_at,opened_by,resolved_at,resolution_code,resolution_notes,escalation,severity,sla_due,contact_type,reassignment_count,reopen_count

ケース番号で検索する場合:

Tool: SN-Query-Table
Parameters:
  table_name: sn_customerservice_case
  query: number=CS0012345
  fields: sys_id,number,short_description,description,state,priority,category,subcategory,contact,account,consumer,product,assigned_to,assignment_group,opened_at,resolution_code,resolution_notes,escalation,sla_due
  limit: 1

REST API を使用する場合:

GET /api/now/table/sn_customerservice_case?sysparm_query=number=CS0012345&sysparm_fields=sys_id,number,short_description,description,state,priority,category,subcategory,contact,account,consumer,product,assigned_to,assignment_group,opened_at,resolution_code,resolution_notes,escalation,sla_due&sysparm_limit=1&sysparm_display_value=true
ステップ 2:メールのやり取りの履歴を確認する

会話のスレッドを把握し、情報の重複を避けるため、このケースに関する過去のメールをすべて取得します。

MCP を使用する場合:

Tool: SN-Query-Table
Parameters:
  table_name: sys_email
  query: instance=<case_sys_id>^ORDERBYDESCsys_created_on
  fields: sys_id,subject,type,recipients,sys_created_on,sys_created_by,body_text,direct,importance,content_type
  limit: 20

REST API を使用する場合:

GET /api/now/table/sys_email?sysparm_query=instance=<case_sys_id>^ORDERBYDESCsys_created_on&sysparm_fields=sys_id,subject,type,recipients,sys_created_on,sys_created_by,body_text,direct,importance&sysparm_limit=20&sysparm_display_value=true
ステップ 3:顧客とアカウントの情報を取得する

パーソナライズとトーンの調整に必要な連絡先とアカウントの詳細を取得します。

MCP を使用する場合:

Tool: SN-Query-Table
Parameters:
  table_name: customer_contact
  query: sys_id=[contact_sys_id]
  fields: sys_id,name,first_name,last_name,email,phone,title,account,preferred_contact_method,timezone
  limit: 1
Tool: SN-Query-Table
Parameters:
  table_name: customer_account
  query: sys_id=[account_sys_id]
  fields: sys_id,name,customer_tier,industry,account_code,notes
  limit: 1

REST API を使用する場合:

GET /api/now/table/customer_contact/{contact_sys_id}?sysparm_fields=name,first_name,last_name,email,phone,title,preferred_contact_method,timezone&sysparm_display_value=true

GET /api/now/table/customer_account/{account_sys_id}?sysparm_fields=name,customer_tier,industry,account_code&sysparm_display_value=true
ステップ 4:SLA のステータスを確認する

SLA の遵守状況を確認し、返信の緊急度とトーンを判断します。

MCP を使用する場合:

Tool: SN-Query-Table
Parameters:
  table_name: sn_customerservice_sla
  query: task=<case_sys_id>^stage!=cancelled
  fields: sys_id,sla,stage,has_breached,planned_end_time,percentage,pause_duration,business_percentage
  limit: 5

REST API を使用する場合:

GET /api/now/table/sn_customerservice_sla?sysparm_query=task=<case_sys_id>^stage!=cancelled&sysparm_fields=sla,stage,has_breached,planned_end_time,percentage,business_percentage&sysparm_limit=5&sysparm_display_value=true
ステップ 5:解決策をナレッジベースで検索する

メールの返信で参照または案内する、関連する KB 記事を探します。

MCP を使用する場合:

Tool: SN-Query-Table
Parameters:
  query: workflow_state=published^short_descriptionLIKE[key_terms]^ORtextLIKE[key_terms]
  table_name: kb_knowledge
  limit: 5
Tool: SN-Query-Table
Parameters:
  table_name: kb_knowledge
  query: workflow_state=published^short_descriptionLIKE[key_terms]^ORtextLIKE[key_terms]
  fields: sys_id,number,short_description,text,kb_category,author,sys_updated_on,rating
  limit: 5

REST API を使用する場合:

GET /api/now/table/kb_knowledge?sysparm_query=workflow_state=published^short_descriptionLIKE<key_terms>&sysparm_fields=number,short_description,text,kb_category,rating&sysparm_limit=5&sysparm_display_value=true
ステップ 6:社内向けのコンテキストとして作業メモを取得する

社内向けの作業メモを取得し、最新の内部分析を反映したメール返信を作成します。

MCP を使用する場合:

Tool: SN-Query-Table
Parameters:
  table_name: sys_journal_field
  query: element_id=<case_sys_id>^element=work_notes^ORDERBYDESCsys_created_on
  fields: value,sys_created_on,sys_created_by
  limit: 10

REST API を使用する場合:

GET /api/now/table/sys_journal_field?sysparm_query=element_id=<case_sys_id>^element=work_notes^ORDERBYDESCsys_created_on&sysparm_fields=value,sys_created_on,sys_created_by&sysparm_limit=10
ステップ 7:メール返信の推奨文案を作成する

収集した情報をまとめ、構成されたメールの下書きを作成します。ケースの状態に応じて複数の案を提示します。

=== EMAIL RESPONSE RECOMMENDATIONS ===
Case: [number] | Customer: [first_name] [last_name] | Tier: [tier]
Category: [category] / [subcategory] | State: [state]
SLA Status: [on_track/at_risk/breached]
Email Thread Length: [count] messages

--- OPTION A: ACKNOWLEDGMENT EMAIL ---
Subject: Re: [original_subject] - Case [number] Received

Dear [first_name],

Thank you for contacting [company_name] support. We have received
your request regarding [short_description] and created case [number]
for tracking purposes.

Our [assignment_group] team is reviewing your request and you can
expect an initial response within [sla_target]. In the meantime,
you may find the following resource helpful:
- [KB article title]: [portal_link]

If you need immediate assistance, please don't hesitate to call us
at [support_phone] or start a live chat session through the portal.

Best regards,
[agent_name]
[assignment_group]

--- OPTION B: STATUS UPDATE EMAIL ---
Subject: Re: [original_subject] - Case [number] Update

Dear [first_name],

I wanted to provide you with an update on your case [number]
regarding [short_description].

[Summary of investigation findings from work notes]

Our next steps are:
1. [next_action_1]
2. [next_action_2]

We expect to have [resolution/further update] by [date]. I will
keep you informed of any developments.

Please let me know if you have any questions or additional
information to share.

Best regards,
[agent_name]

--- OPTION C: RESOLUTION EMAIL ---
Subject: Re: [original_subject] - Case [number] Resolved

Dear [first_name],

I'm pleased to let you know that your case [number] regarding
[short_description] has been resolved.

Resolution Summary:
[resolution_notes]

Root Cause: [root_cause if applicable]
Steps Taken: [summary of actions]

For future reference, you can find detailed instructions in our
knowledge base article: [KB article number and title]

If this issue recurs or you have any other questions, please don't
hesitate to reach out. You can reopen this case by simply replying
to this email.

Thank you for your patience, and we appreciate your business.

Best regards,
[agent_name]

--- OPTION D: ESCALATION NOTIFICATION EMAIL ---
Subject: Re: [original_subject] - Case [number] Escalated

Dear [first_name],

I want to let you know that your case [number] has been escalated
to our [escalation_group] team for specialized attention.

Your case is being prioritized and [escalation_contact] will be
reaching out to you directly within [timeframe]. You can also reach
them at [escalation_email/phone].

We understand the urgency of this matter and are committed to
resolving it as quickly as possible.

Best regards,
[agent_name]

ツールの使用方法

MCP ツールのリファレンス
ツール使用場面
SN-Natural-Language-Search顧客の問題に合致する KB 記事を自然言語で検索する場合
SN-Query-Tableメール、ケース履歴、SLA ステータスを構造化クエリで検索する場合
SN-Get-Recordsys_id を指定して単一のケースまたは連絡先のレコードを取得する場合
REST API リファレンス
エンドポイントメソッド用途
/api/now/table/sn_customerservice_caseGETケースの詳細を検索する
/api/now/table/sys_emailGETメールのやり取りの履歴を取得する
/api/now/table/kb_knowledgeGETナレッジベースの記事を検索する
/api/now/table/sys_journal_fieldGET社内向けのコンテキストとして作業メモを取得する
/api/now/table/customer_accountGETアカウントのティアと詳細を取得する
/api/now/table/customer_contactGET連絡先の氏名、メールアドレス、設定を取得する
/api/now/table/sn_customerservice_slaGETSLA のステータスと違反情報を取得する

ベストプラクティス

  • スレッドの継続性を維持する: メールスレッドを維持できるよう、件名には必ず「Re:」を付け、ケース番号を記載してください
  • 階層に合わせてフォーマルさを調整する: Gold/Platinum 階層のお客様には、よりフォーマルで個別対応を意識した表現を使います。標準階層のお客様には、プロフェッショナルかつ簡潔な表現を使います
  • 遅延を認める: SLA の期限に間に合わない恐れがある場合、または期限を過ぎた場合は、状況を伝える前に遅延を率直に認め、謝罪します
  • セルフサービス用リンクを含める: お客様が今後、自力で回答を見つけられるよう、KB 記事やポータルへのリンクを案内します
  • 内部情報を避ける: お客様向けメールで、内部作業メモ、担当者の変更、システムの詳細を決して公開しないでください
  • 次の手順を明確にする: すべてのメールの末尾に、次に何がいつ行われるかを明記します
  • 過去のメールを確認する: すでに提示された質問や情報を繰り返さないよう、必ずメールスレッドを確認します
  • トーンを校正する: 特に不満を抱えているお客様やエスカレーションされたケースでは、共感とサポートの姿勢が伝わる文面にします
  • タイムゾーンを考慮する: 可能な場合は、お客様の営業時間内にメールを送信するよう設定します

トラブルシューティング

「メール履歴が見つかりません」

原因: メールが別の対象レコードに保存されているか、ケースがメール以外のチャネルで作成された可能性があります
解決策: target_table=sn_customerservice_case^instance=<case_sys_id> を使ってクエリを試してください。また、sysparm_query=subject_LIKE[case_number] を使って、元のメールによって別のレコードが作成されていないか確認します。

「お客様の連絡先メールアドレスがありません」

原因: 連絡先レコードにメールアドレスが入力されていない可能性があります
解決策: csm_consumer レコードでメールアドレスを確認します。連絡先が内部ユーザーの場合は、sys_user も確認してください。連絡先のメールアドレスがない場合は、opened_by のメールアドレスを使用します。

「SLA データを利用できません」

原因: このケースの種類またはカテゴリに対して、SLA の定義が設定されていない可能性があります
解決策: ケースの担当グループと優先度について、contract_sla テーブルをクエリし、SLA が存在するか確認します。SLA が定義されていない場合は、メールで SLA に言及せず、一般的な所要時間を使用します。

「KB 記事が関連していません」

原因: 検索語が具体的すぎるか、KB でこのトピックを扱っていない可能性があります
解決策: 検索語を段階的に広げます。まず正確な short_description を使い、次に個々のキーワードを試し、その後カテゴリ名だけで検索します。組織で製品ごとに別のナレッジベースを使用している場合は、複数のナレッジベースを確認します。

例

例 1:ソフトウェアライセンスの問題に対する初回返信

シナリオ: お客様から、ソフトウェアライセンスのアクティベーションに失敗したというメールが届きました。

手順 1 - ケースを取得:

Tool: SN-Query-Table
Parameters:
  table_name: sn_customerservice_case
  query: number=CS0081234
  fields: sys_id,number,short_description,description,state,priority,category,subcategory,contact,account,product,assigned_to,assignment_group,sla_due
  limit: 1

手順 2 - KB を検索:

Tool: SN-Query-Table
Parameters:
  query: workflow_state=published^123TEXTQUERY321=software license activation failure error code
  table_name: kb_knowledge
  limit: 3

生成されたメール:

Subject: Re: License Activation Error - Case CS0081234

Dear Sarah,

Thank you for contacting TechCorp Support regarding the license
activation issue with DataSync Pro. I've created case CS0081234
to track your request.

I found a knowledge base article that addresses the most common
activation errors:
- KB0023456: "Resolving DataSync Pro License Activation Errors"
  Link: https://support.techcorp.com/kb/KB0023456

Could you try the steps in Section 3 of that article? If the issue
persists, please reply with:
1. The exact error message or error code displayed
2. Your license key (last 4 characters only)
3. The operating system version

I'm targeting to have this resolved for you by March 20th.

Best regards,
Alex Thompson
Software Support Team
例 2:重大なサービス停止に関するエスカレーションメール

シナリオ: サービス停止に関するお客様の P1 ケースについて、エスカレーション通知が必要です。

手順 1 - ケースと SLA を取得:

Tool: SN-Get-Record
Parameters:
  table_name: sn_customerservice_case
  sys_id: [case_sys_id]
  fields: number,short_description,state,priority,escalation,contact,account,assigned_to,sla_due,opened_at
Tool: SN-Query-Table
Parameters:
  table_name: sn_customerservice_sla
  query: task=<case_sys_id>^stage!=cancelled
  fields: sla,stage,has_breached,planned_end_time,percentage
  limit: 3

生成されたメール:

Subject: URGENT: Case CS0082001 Escalated - Service Outage

Dear Michael,

I want to personally update you on your critical case CS0082001
regarding the API gateway outage affecting your production systems.

Your case has been escalated to our Senior Engineering team and is
receiving immediate priority attention. Here is your escalation
contact information:

  Escalation Lead: Jennifer Walsh, Senior Platform Engineer
  Direct Line: +1 (555) 012-3456
  Email: [email protected]

Current Status:
- Our team has identified the affected components
- A hotfix is being developed and tested
- Estimated resolution: within the next 2 hours

We will provide updates every 30 minutes until this is resolved.
You can also monitor real-time status at status.techcorp.com.

We sincerely apologize for the impact this is having on your
operations and are fully committed to restoring service as
quickly as possible.

Best regards,
David Martinez
Critical Incident Manager

関連スキル

  • csm/case-summarization - メールの下書きを作成する前にケースの詳細を要約します
  • csm/chat-recommendation - メールではなく、チャットの返信を生成します
  • csm/sentiment-analysis - お客様の感情を評価し、メールのトーンを調整します
  • csm/resolution-notes - ケース終了メール用の解決内容を記録します
  • knowledge/content-recommendation - メールで参照するナレッジベースを詳しく検索します

コメント