Multi Account Queryのロゴ

Multi Account Query

組織
aliyun
multi-account-query

Query Alibaba Cloud resources across multiple accounts in a Resource Directory. Resolves member account aliases to UIDs via ResourceDirectory ListAccounts, then uses x_assume_account_id to assume into the target account for CLI calls. Use when the user references a member account by display name or alias, or explicitly asks to query resources in another account under the same RD. MUST be loaded for any cross-account or member-account operation before calling AlibabaCloud___CallCLI with x_assume_account_id.

概要

公開者aliyun
リポジトリalibabacloud-agent-toolkit
スキル名multi-account-query
スター
29
フォーク
13
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    aliyunがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Multi Account Query」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/aliyun/alibabacloud-agent-toolkit/tree/main/plugins/alibabacloud-core/skills/multi-account-query
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aliyun/alibabacloud-agent-toolkit.git /tmp/alibabacloud-agent-toolkit
mkdir -p .claude/skills
cp -r /tmp/alibabacloud-agent-toolkit/plugins/alibabacloud-core/skills/multi-account-query .claude/skills/multi-account-query
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMulti Account Queryを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にMulti Account Queryを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Multi Account Queryは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Multi-Account Resource Query

Query Alibaba Cloud resources across member accounts in a Resource Directory (RD) organization. When the user refers to an account by its display name (alias) rather than its UID, this skill resolves the alias first, then assumes into the target account to execute the actual resource query.

Scope Check Before You Start

This skill resolves the cross-account routing layer only — alias→UID, plus the assume-role hop. If the user's actual request is a multi-account solution pattern — key rotation across all members, drift / cost / RAM audits, billing aggregation, organization-wide compliance scans — invoke alibabacloud-find-skills first; a packaged multi-account-ops skill captures the full workflow (iteration, error rollup, reporting), not just the cross-account hop. Use this skill directly only when the user just needs the routing primitive for a single-shot query. Full trigger conditions are in mcp-core-best-practices → Skill Discovery.

Prerequisites

  • The current credentials must belong to an RD management account (or a delegated administrator) with resourcedirectory:ListAccounts permission.
  • A cross-account assume role (default: ResourceDirectoryAccountAccessRole) must exist in target member accounts.

Workflow

1. Determine Whether Cross-Account Access Is Needed

If the user explicitly provides an account ID (UID), skip to step 3.

If the user refers to an account by display name, alias, or any non-numeric identifier, proceed to step 2 to resolve it.

2. Resolve Account Alias to UID

Use AlibabaCloud___CallCLI to list member accounts. The API returns at most 100 accounts per page, so always set --page-size 100 and handle pagination when the organization has more than 100 accounts:

aliyun resourcedirectorymaster list-accounts --page-size 100 --page-number 1

From the response, find the account whose DisplayName matches the user's input. Extract its AccountId field — this is the UID needed for cross-account access.

If the target is not found in the first page, increment --page-number and continue fetching until the target is found or all pages are exhausted (total account count is returned in the response's TotalCount field).

If no match is found, report to the user and ask for clarification. Do not guess account IDs.

3. Execute the Resource Query in the Target Account

When calling AlibabaCloud___CallCLI for the actual resource query, pass the x_assume_account_id parameter with the resolved UID. This tells the MCP server to assume into the target account before executing the command.

Example — list ECS instances in member account "dev-team":

# Step 1: Resolve "dev-team" to its UID
AlibabaCloud___CallCLI(command="aliyun resourcedirectorymaster list-accounts --page-size 100 --page-number 1")
# → find AccountId where DisplayName == "dev-team", e.g. "1234567890123456"
# → if not found and TotalCount > 100, continue with --page-number 2, 3, ...

# Step 2: Query resources in that account
AlibabaCloud___CallCLI(
  command="aliyun ecs describe-instances --region cn-hangzhou",
  x_assume_account_id="1234567890123456"
)

4. Present Results

Return the query results to the user. If the user asks about multiple accounts, repeat steps 2–3 for each account, or iterate over all accounts from the ListAccounts response.

Parameter Reference

ParameterDescription
x_assume_account_idTarget member account UID. The MCP server assumes into this account using the default cross-account role.
x_assume_role_nameOverride the default role name if the target account uses a custom role (default: ResourceDirectoryAccountAccessRole).
x_assume_role_arnFull ARN of the role to assume. Takes highest priority over account_id + role_name.

Error Handling

  • AccessDenied on ListAccounts: The current credentials lack RD read permission. Ask the user to verify they are using the management account.
  • AssumeRole failed: The target account may not have the expected role, or the role trust policy does not allow the current account. Report the error and suggest the user check the role configuration.
  • Account not found: The display name does not match any member account. List available account names to help the user pick the correct one.

Guardrails

  • Always resolve aliases via the ListAccounts API. Never guess or hardcode account IDs.
  • Do not cache account lists across conversations — accounts can be added or removed at any time.
  • When iterating over multiple accounts, include the account display name and ID in the output so the user can verify correctness.
  • Respect the principle of least privilege: only query the resources the user asked about, do not enumerate all resources in all accounts unless explicitly requested.

よくある質問

AIスキル「Multi Account Query」では何ができますか?

Query Alibaba Cloud resources across multiple accounts in a Resource Directory. Resolves member account aliases to UIDs via ResourceDirectory ListAccounts, then uses x_assume_account_id to assume into the target account for CLI calls. Use when the user references a member account by display name or alias, or explicitly asks to query resources in another account under the same RD. MUST be loaded for any cross-account or member-account operation before calling AlibabaCloud___CallCLI with x_assume_account_id.

TypingMindでMulti Account Queryを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Multi Account Queryはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMulti Account Queryをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/aliyun/alibabacloud-agent-toolkit/tree/main/plugins/alibabacloud-core/skills/multi-account-queryを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Multi Account Queryを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Multi Account Queryで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMulti Account Queryを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Multi Account Query」は無料ですか?

はい。aliyunがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇