Carta CRM(営業管理システム)から企業の記録を検索して取得します。 **次のような場合に使用:** - 「企業を検索する」「企業の詳細を表示してほしい」 - 「[企業名]について教えてほしい」 - 「ID または ドメインで企業を検索する」 - 「登録している企業一覧を表示する」 - 「/search-companies」というコマンドを使う 返された結果には、企業ID、企業名、カスタムフィールド(カスタマイズされた情報項目)などの企業詳細が含まれます。返された企業IDは、企業情報を更新するスキルで使用することができます。
Searches for and retrieves company records from the Carta CRM. Use this skill when the user says things like "find a company", "search companies", "look up a company", "show me company details for [name]", "full details on [name]", "tell me about [name]", "get company by ID", "get company by domain", "list companies", "what companies do we have", or "/search-companies". Returns company details including ID, name, and custom fields. The company ID returned can be used with the update-company skill.
<!-- carta:plugin-version --> <carta-plugin>carta-crm:1.15.0</carta-plugin>
Carta CRM(顧客関係管理システム)で企業情報を検索できます。特定の企業1社についての質問なら、その企業のカード(詳細情報)を表示します。複数企業の検索なら、表形式で結果を表示します。この違いで進め方が全く変わるため、最初にここを判断してください。
fetch_company_by_domain が自動的に1社に特定しますユーザーが1社の名前を挙げたなら、「検索して」「探して」と言われても、それは詳細情報リクエストです。本当に判断できない場合は、一覧として扱い、「何で絞ってお探しですか?」と確認してください。
必ず crm_call_tool で確認し、crm_view_tool は使わないこと。 この段階はあなたが確認するためのもので、ユーザーのためではありません。ビュー呼び出しを使うと、返された配列がすべて個数に圧縮されるため、行データと必要な id が手に入らず、ユーザーも求めていない一覧が表示されてしまいます。
crm_call_tool({
"name": "crm:search_companies",
"arguments": { query: "<企業名>", limit: 10 }
})
返ってきた候補の数で分岐:
crm_view_tool({ "name": "crm:fetch_company_by_id", "arguments": { id: "<id>" } })
crm_view_tool({
"name": "crm:search_companies",
"arguments": { query: "<企業名>", limit: 10 }
})
「複数の企業がマッチしました。どちらを探していましたか?」と聞き、選ばれたら fetch_company_by_id で詳細を取得してください。確認なしに上位を開くと、間違った記録が確信を持って表示されてしまいます。ドメイン指定の場合、名前解決は不要 — 1回の呼び出しで1社のカード表示:
crm_view_tool({ "name": "crm:fetch_company_by_domain", "arguments": { domain: "<ドメイン>" } })
1回のリクエストで表示するカードは最大1枚。ユーザーが複数社を挙げた場合は、カードを重ねるのではなく、どれを開くか聞いてください。
ユーザーのフィルター条件が特定のフィールドに対応している場合、まず使える field_id を確認します。これはスキーマ(データ定義)の照会なので、crm_call_tool を通します:
crm_call_tool({ "name": "crm:get_company_fields", "arguments": {} })
ユーザーの意図を最も具体的にマッチするフィールドにあてはめ、filters({ field_id, operator, value })として渡します。フィールドがマッチしない場合だけ、自由記述の query にフォールバック(切り替え)します。field_id を推測してはいけません — 組織ごとに異なります。
crm_view_tool({
"name": "crm:search_companies",
"arguments": {
query: "<検索語>",
limit: 20
}
})
ユーザーがもっと見たいと言ったら、limit を増やします。ページ送りには offset を使ってください。
CRM ビューは組織ごとに有効化されており、1社の詳細ビューはさらにその上に追加フラグが必要です。そのため、上記の crm_view_tool 呼び出しが以下のように返ることがあります:
CRM tool 'search_companies' has no view — call it with crm_call_tool instead. (CRM ツール「search_companies」にはビューがありません — crm_call_tool で呼び出してください)
これは失敗ではなく、通常の応答です。その組織ではビューが有効化されていません。その1呼び出しを crm_call_tool で同じ内容でもう一度実行し、結果をテキストで提示してください(ステップ4参照)。crm_view_tool を再試行したり、ユーザーにメッセージを報告したりしないでください。
詳細情報リクエストで、カードに対応するビューがない場合も、同じように処理します。ステップ2の crm_call_tool による確認を続け、選ばれた企業をテキストで表示してください。
カードが表示された場合、ユーザーには完全な記録が見えています。フィールドを改めて述べないでください。ユーザーが聞いたことに答えるか、1行で確認するだけにします。
表が表示された場合、ユーザーはすべての行を見ています。テキストで再掲、整形し直し、要約してはいけません — 表と重複します。ユーザーが本当に聞いている質問に答えるか、1行で確認するだけにします(例:「14社が見つかりました — ID は最初の列に表示されており、/update-company で使用できます」)。
crm_call_tool にフォールバックした場合、空でないフィールドをすべて読みやすくまとめて表示し、ID は目立つようにしてください — ユーザーが /update-company を実行するときに必要です。
企業が見つからない場合:
「検索条件に合う企業が見つかりません。別の企業名、キーワード、またはドメインを試してください。」
<!-- carta:plugin-version --> <carta-plugin>carta-crm:1.15.0</carta-plugin>
Look up companies in the Carta CRM. A request about one named company renders that company's card; a request for a set renders a table. Route on that distinction first — it decides every call below.
fetch_company_by_domain already identifies one record.A named single company is a detail request even when the user says "search" or "find". If it's genuinely unclear, treat it as a list and ask what they want to narrow to.
Resolve through crm_call_tool, never crm_view_tool. This step is for you, not the
user: a view call collapses every array in the response to a count, so the rows — and the
id you need — never reach you, and the user gets a list they did not ask for.
crm_call_tool({
"name": "crm:search_companies",
"arguments": { query: "<company name>", limit: 10 }
})
Then branch on how many candidates came back:
crm_view_tool({ "name": "crm:fetch_company_by_id", "arguments": { id: "<id>" } })
crm_view_tool({
"name": "crm:search_companies",
"arguments": { query: "<company name>", limit: 10 }
})
Then ask: "Several companies match — which one did you mean?" When they pick, call
fetch_company_by_id for it. Opening the top hit unasked shows the wrong record with
full confidence.By domain, there is nothing to resolve — one call, one card:
crm_view_tool({ "name": "crm:fetch_company_by_domain", "arguments": { domain: "<domain>" } })
Render at most one card per request. If the user named several companies, ask which to open rather than stacking views.
When the user's filters map to specific fields, discover the valid field_ids first. This
is a schema lookup, so it goes through crm_call_tool:
crm_call_tool({ "name": "crm:get_company_fields", "arguments": {} })
Map the user's intent to the most specific matching fields and pass them as filters
({ field_id, operator, value }). Fall back to the free-text query only when no field
matches. Never guess a field_id — they vary per organisation.
crm_view_tool({
"name": "crm:search_companies",
"arguments": {
query: "<search term>",
limit: 20
}
})
Increase limit if the user asks to see more results. Use offset to paginate.
CRM views are enabled per organisation, and single-record views behind a second flag on
top of that. So any crm_view_tool call above may answer with:
CRM tool 'search_companies' has no view — call it with crm_call_tool instead.
That is a normal response, not a failure — this organisation does not have that view
enabled. Retry that one call verbatim through crm_call_tool and present the result as
text per Step 4. Do not retry crm_view_tool, and do not report the message to the
user.
A detail request whose card has no view still resolves the same way: keep the
crm_call_tool resolve from Step 2 and present the chosen record as text.
When a card rendered, the user sees the whole record. Do not restate its fields. Answer what they asked, or acknowledge in one line.
When a table rendered, the user already sees every row. Do NOT re-list, re-format, or
summarise them as text — that duplicates the table. Answer the question they actually
asked, or acknowledge in one line (e.g. "Found 14 companies — the ID is in the first
column, for /update-company.").
When you fell back to crm_call_tool, display all non-empty fields in a readable
summary and show the ID prominently — the user will need it to run /update-company.
If no companies are found:
"No companies found matching your search. Try a different name, keyword, or domain."
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。