> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Agent.getInstructions() `.getInstructions()` メソッドは、Agent に設定された instructions を取得し、関数の場合は解決します。これらの instructions は Agent の動作を導き、その機能と制約を定義します。 ## 使用例 ```typescript await agent.getInstructions() ``` ## パラメータ **options** (`{ requestContext?: RequestContext }`): リクエストコンテキストを含む任意の設定オブジェクト。 (Default: `{}`) **options.requestContext** (`RequestContext`): 依存性注入とコンテキスト情報に使う Request Context。 ## 戻り値 **instructions** (`SystemMessage | Promise`): Agent に設定された instructions。SystemMessage には string | string\[] | CoreSystemMessage | CoreSystemMessage\[] | SystemModelMessage | SystemModelMessage\[] を指定できます。instructions は直接返されるか、instructions へ解決される Promise として返されます。 ## 詳細な使用例 ```typescript await agent.getInstructions({ requestContext: new RequestContext(), }) ``` ## 関連項目 - [Agent の概要](https://mastra.zisheng.pro/ja/docs/agents/overview) - [Request Context](https://mastra.zisheng.pro/ja/docs/server/request-context)