Tools と MCP | Kiro と学ぶ Strands Agents 02

Riku INADA PRO
November 09, 2026

Tools と MCP | Kiro と学ぶ Strands Agents 02

Level 200。Strands Agents の公式ドキュメントの Tools の章 (Attach and invoke、Use MCP tools、Create custom tools) に沿って、エージェントにツールを渡す方法を学ぶ回です。@tool の関数、SDK に付属のツール、クラスと async のツールを Agent に渡す方法、ツールを直接呼ぶ方法、並行と順番 (Sequential) の実行器の違いを、構成図、流れの図、イメージ図で説明します。MCPClient で MCP サーバーをつなぐ方法 (with での接続の管理、stdio と Streamable HTTP の transport、AWS IAM (SigV4) で守られたサーバーへの MCPClient の作り方、複数のサーバーと prefix、tool_filters) と、docstring と型ヒントがツールの仕様になる仕組み、成功とエラーの返し方、invocation_state で値を渡す方法も扱います。架空のネットの家電のお店の問い合わせ窓口のエージェントのコードを、東京のリージョンの Amazon Bedrock で動かした本物の出力を載せます。シリーズ「Kiro と学ぶ Strands Agents」の 02 (はじめる) です。

Riku INADA PRO

November 09, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

40 slides
  1. Kiro と学ぶ Strands Agents 02 はじめる Tools と MCP @tool、付属のツール、MCP

    サーバー Level 200 / 2026-11 時点 2026 年 11 ⽉ 稲⽥ ⼤陸 アマゾン ウェブ サービス ジャパン © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 02 Kiro + Strands Agents 1
  2. はじめに ⾃⼰紹介 稲⽥ ⼤陸 いなだ りく (いなりく) アマゾン ウェブ サービス

    ジャパン合同会社 ソリューションアーキテクト 製造業のお客様を中⼼に⽀援 最近の取り組み AI 駆動開発ライフサイクルの推進 Kiro と AWS Amplify の情報発信 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. X @inada_riku Speaker Deck speakerdeck.com/inariku Zenn zenn.dev/inariku GitHub github.com/inariku 2
  3. はじめに シリーズの中の位置 いまは 02 Tools と MCP、次は 03 Hooks と

    Lifecycle controls はじめる 01–02 作り込む 03–07 確かめる 前に読む Strands Agents 01 をはじめる 次に読む Hooks と Lifecycle 03 controls 02 Tools と MCP 04 と Plugins Interventions 09 Observability と Evals 09 載せて広げる 08–10 Deploy と Secure 08 for production 10 Strands harness 05 Sessions と Memory output 06 Structured と Streaming 07 Multi-agent © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3
  4. 02 Tools と MCP @tool 第 1 部 ツールを 渡して呼ぶ

    © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. def track_order(...) Tool #1: track_order 5
  5. 1 ツールを渡して呼ぶ いちばん⼩さい Agent とツール minimal.py from strands import Agent,

    tool from d02.base import PROMPT, model 出⼒ @tool def track_order(order_id: str) -> str: """注⽂の配送の状況を返す。""" return f"{order_id} は配送中です" Agent はツールの説明 (docstring) を Tool #1: track_order 配送中です。 到着をお待ちください。 読んで、呼ぶかどうかを決める。 model (東京の Amazon Bedrock) と PROMPT の中⾝は付録 A1 agent = Agent(model=model, tools=[track_order], system_prompt=PROMPT) agent("ORD-5488 は今どうなっていますか") © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6
  6. 1 ツールを渡して呼ぶ tools には 3 種類のツールを並べられる @tool の関数、付属のツール、MCP サーバーのツール (MCPClient)

    を同じリストで渡す MCP (Model Context Protocol) は、モデルに⽂脈を渡すための公開の標準 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
  7. 1 ツールを渡して呼ぶ SDK に付属のツール (vended tools) ツール すること ツール すること

    Edit ファイルをその場で書き換える Handoff to User ループを⽌めて利⽤者に伝える Read ファイルを番号付きで読む Stop 済んだらループを終える Write ファイルを作るか上書きする Web Fetch URL を Markdown にして返す HTTP Request 外の API を HTTP で呼ぶ A2A Client A2A のエージェントに送る Notebook 残るテキストのノート Python REPL sandbox で Python を動かす Bash シェルの命令を続けて動かす Subagent ⼦の Agent に任せる MCP Router 許可した MCP サーバーにつなぐ Swarm 複数の Agent が swarm で組む Sleep 決めた⻑さだけ⽌まる Graph ⼦の Agent を DAG で動かす このほかに File Editor があるが、⾮推奨 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
  8. 1 ツールを渡して呼ぶ 載ったツールを確かめる listing.py の 7〜15 ⾏⽬ agent = Agent(model=model,

    tools=[lookup_customer, read]) print(agent.tool_names) reg = agent.tool_registry cfg = reg.get_all_tools_config() spec = cfg["lookup_customer"] print(json.dumps(spec, ensure_ascii=False, indent=1)) 出⼒の 1〜4 ⾏⽬ (このあと inputSchema が続く) ['lookup_customer', 'read'] { "name": "lookup_customer", "description": "お客さんを ID で調べる。", © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. tool_names は名前の⼀覧。 get_all_tools_config() は説明と引数を 含む JSON 9
  9. 1 ツールを渡して呼ぶ ツールの 2 つの呼び⽅ ⾃然⽂で頼む コードから直接呼ぶ agent("...") agent.tool.<名前>() モデルが選ぶ

    モデルを通らない get_order_history get_order_history +4 agent.messages 0件→4件 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. +4 会話履歴に残る 4件→8件 two_ways.py の 10〜15 ⾏⽬ agent("C-1002 の注⽂を教えてください") print("prompt:", len(agent.messages)) agent.tool.get_order_history( customer_id="C-1002") print("direct:", len(agent.messages)) 出⼒ (会話の履歴の数) prompt: 4 direct: 8 どちらの呼び⽅でも、呼び出しと 結果が会話の履歴に残る 10
  10. 1 ツールを渡して呼ぶ 直接呼ぶときはキーワード引数で direct.py の 5〜16 ⾏⽬ @tool(name="check-stock") def check_stock(item:

    str) -> str: """品物の在庫の数を返す。""" return f"{item}: 在庫 3 個" 出⼒ success [{'text': 'ハブ: 在庫 3 個'}] error 位置引数は使えず、結果が error になった。名前の agent = Agent(model=model, tools=[check_stock]) ok = agent.tool.check_stock(item="ハブ") ng = agent.tool.check_stock("ハブ") # 位置引数 print(ok["status"], ok["content"]) print(ng["status"]) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. ハイフン (check-stock) は、 下線 (check_stock) に替えて呼ぶ 11
  11. 1 ツールを渡して呼ぶ 並⾏に動くのは、1 回の応答に要求が複数あるときだけ 1 回の応答に toolUse が 2 つ

    parallel.py の出⼒ check_member 3.0s start check_member 3.0s start track_parcel 4.0s end check_member 5.0s end track_parcel 1秒 2秒 track_parcel 0 1 Concurrent 2 全体 2.0 秒 要求を 1 つずつ返したときは、既定の モデルが 1 回の応答で 2 つの 3 秒 要求を返し、2 つが同時に 始まった。全体の時間は、 いちばん遅いツールで決まる ConcurrentToolExecutor でも 1 つずつ動く © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
  12. 1 ツールを渡して呼ぶ 後のツールが前のツールに頼るなら Sequential 例: 画⾯を撮ってから、その画⾯を screenshot_tool メールで送る。後のツールが前の ツールの結果に頼る parallel.py

    を seq で動かした出⼒ 添付がまだ無い email_tool 4.8s start check_member 5.8s end check_member 5.8s start track_parcel 7.8s end track_parcel tool_executor に SequentialToolExecutor() を 渡すと、与えた順に動く © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13
  13. 02 Tools と MCP 第 2 部 MCPClient delivery_server.py get_delivery_status

    MCP サーバーを つなぐ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
  14. 2 MCP サーバーをつなぐ いちばん短い接続: Agent に MCPClient を渡す mcp_min.py from

    mcp import stdio_client from mcp import StdioServerParameters from strands import Agent from strands.tools.mcp import MCPClient from d02.base import PROMPT, model delivery = MCPClient(lambda: stdio_client( StdioServerParameters( command="python", args=["delivery_server.py"]))) agent = Agent(model=model, tools=[delivery], system_prompt=PROMPT) agent("ORD-5390 の荷物は今どこですか") © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 出⼒ Tool #1: get_delivery_status 現在配送中です。 11/10午後に到着予定です。 MCPClient は ToolProvider なので Agent に直接渡せる。接続を開くのも 閉じるのも⾃動。宅配便の会社の MCP サーバー (delivery_server.py、 中⾝は付録 A2) を stdio で動かした 16
  15. 2 MCP サーバーをつなぐ with で接続を⾃分で管理する mcp_with.py の 5〜11 ⾏⽬ with

    delivery: tools = delivery.list_tools_sync() print([t.tool_name for t in tools]) agent = Agent(model=model, tools=tools, system_prompt=PROMPT) agent("ORD-5488 の荷物は今どこですか") 出⼒ ['get_delivery_status', 'change_delivery_date'] Tool #1: get_delivery_status 東京の配送所を出ました。 11/11午前に届きます。 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 接続を開く時と閉じる時を⾃分で 決めたいときの形。with の 中でツールを取り、Agent を 作って呼ぶ 17
  16. 2 MCP サーバーをつなぐ with の外で呼ぶと、ツールが失敗する mcp_outside.py の 7〜14 ⾏⽬ with

    delivery: tools = delivery.list_tools_sync() agent = Agent(model=model, tools=tools, system_prompt=PROMPT, callback_handler=None) # ここは with の外 agent("ORD-5488 の荷物は今どこですか") 出⼒ error Error: the client session is not running. 申し訳ございません。 状況の確認ができませんでした。 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. with を出ると接続が閉じ、 ツールの結果が error になった。 呼ぶのも with の中で 18
  17. 2 MCP サーバーをつなぐ transport の選び⽅ transport 向いているサーバー MCPClient に渡すもの stdio

    ⼿元のプロセスや命令で動く サーバー stdio_client を返す関数 Streamable HTTP HTTP の先のサーバー。 OAuth の認証付きも url Streamable HTTP + SigV4 AWS IAM の認証で守られた AWS のサーバー aws_iam_streamablehttp_client を返す関数 Server-Sent Events (SSE) 古い SSE の transport の HTTP サーバー sse_client を返す関数 変わるのは transport だけで、Agent への渡し⽅は同じ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
  18. 02 Tools と MCP agent.tool_names 第 3 部 get_delivery_status リモートと

    複数のサーバー get_stock © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. HTTP 20
  19. 3 リモートと複数のサーバー Streamable HTTP は url を渡す mcp_http.py from strands

    import Agent from strands.tools.mcp import MCPClient from d02.base import PROMPT, model store = MCPClient( url="http://127.0.0.1:8765/mcp") with store: tools = store.list_tools_sync() print([t.tool_name for t in tools]) agent = Agent(model=model, tools=tools, system_prompt=PROMPT) agent("USB-C ハブの在庫はありますか") © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 出⼒ ['get_stock', 'list_items'] Tool #1: get_stock 在庫は3個あります。 ご注⽂をお待ちしております。 url を渡すと MCPClient が transport を 作る。認証のヘッダーは headers= で ⾜す。お店の在庫の MCP サーバーを⼿元の 127.0.0.1:8765 で動かした 21
  20. 3 リモートと複数のサーバー AWS IAM (SigV4) で守られたサーバー iam_check.py (作るだけで、つながない) # SigV4

    の MCP サーバーへの MCPClient を作る (つながない) # (uv run --with mcp-proxy-for-aws -m d02.iam_check) from mcp_proxy_for_aws.client import ( aws_iam_streamablehttp_client as iam_client) from strands.tools.mcp import MCPClient 出⼒ MCPClient を作った client = MCPClient(lambda: iam_client( endpoint="https://example.com/mcp", aws_region="ap-northeast-1", aws_service="bedrock-agentcore")) print(type(client).__name__, "を作った") pip install mcp-proxy-for-aws で⼊れ、aws_iam_streamablehttp_client を 返す関数を MCPClient に渡す。資格情報と署名は、このパッケージが扱う © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
  21. 3 リモートと複数のサーバー 複数のサーバーを 1 つの Agent に two_servers.py の 6〜16

    ⾏⽬ # 宅配便の会社 (stdio) と、お店の在庫 (HTTP) delivery = MCPClient(delivery_server) store = MCPClient( url="http://127.0.0.1:8765/mcp") 出⼒ agent = Agent(model=model, tools=[delivery, store], system_prompt=PROMPT) for name in agent.tool_names: print(name) agent("キーボードの在庫と ORD-5390 の荷物は") Tool #1: get_stock get_delivery_status change_delivery_date get_stock list_items Tool #2: get_delivery_status キーボードは在庫切れです。 荷物は本⽇午後に届く予定です。 並べて渡すと、4 つのツールが載った © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
  22. 3 リモートと複数のサーバー 同じ名前のツールは prefix で分ける 同じ名前のツールが 2 つあると、 同じ名前 Agent

    を作るときにエラーになる collide.py の 16〜17 ⾏⽬ 宅配便 A 宅配便 B east = MCPClient(srv, prefix="east") west = MCPClient(srv, prefix="west") 出⼒の 2〜5 ⾏⽬ east_get_delivery_status east_change_delivery_date west_get_delivery_status west_change_delivery_date 出⼒の 1 ⾏⽬ (prefix なしで 2 つ渡した) prefix がツール名の頭に付く Tool name 'get_delivery_status' already exists © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
  23. 3 リモートと複数のサーバー tool_filters で載せるツールを絞る filters.py の 5〜15 ⾏⽬ 出⼒ filters

    = [ {"allowed": ["get_delivery_status"]}, {"allowed": [re.compile(r"^change_")]}, {"allowed": [re.compile(r".*_delivery_.*")], "rejected": ["change_delivery_date"]}, ] for f in filters: client = MCPClient(srv, tool_filters=f) with client: tools = client.list_tools_sync() print([t.tool_name for t in tools]) ['get_delivery_status'] ['change_delivery_date'] ['get_delivery_status'] © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. allowed は名前か正規表現で 選ぶ。rejected と組むと、 allowed を先に当ててから rejected で外す 25
  24. 02 Tools と MCP find_orders.tool_spec 第 4 部 "name": "find_orders"

    ツールを ⾃分で作る "description": ... © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. "inputSchema": {...} 26
  25. 4 ツールを⾃分で作る docstring と型ヒントがツールの仕様になる spec.py の 5〜14 ⾏⽬ 出⼒の 1〜15

    ⾏⽬ @tool def find_orders(customer_id: str, limit: int = 3) -> str: """注⽂を新しい順に返す。 { "name": "find_orders", "description": "注⽂を新しい順に返す。", "inputSchema": { "json": { "properties": { "customer_id": { "description": "お客さんの ID", "type": "string" }, "limit": { "default": 3, "description": "返す注⽂の数の上限", "type": "integer" } Args: customer_id: お客さんの ID limit: 返す注⽂の数の上限 """ return f"{customer_id}: {limit} 件まで" 最初の段落が description、Args の節が 各引数の説明になる © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 27
  26. 4 ツールを⾃分で作る ツールの説明に書く 5 つのこと 書くこと 1 ツールの⽬的と、何ができるか 2 いつ使うか

    3 受け取る引数と、その形 4 返す出⼒の形 5 制限や制約 モデルはツールの説明を頼りに、いつどう使うかを決める。説明がよいほど、正しく 使われる © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
  27. 4 ツールを⾃分で作る 戻り値がツールの結果に変わる 3 つの規則 @tool の関数がすること モデルに返る ToolResult return

    f"{order_id} は配送中" "success"、{"text": str(返り値)} return {"status": ..., "content": [...]} その dict をそのまま使う raise ValueError(...) "error" の結果に変える results.py の出⼒ (3 つを agent.tool で呼んだ) success [{'text': 'ORD-5488 は配送中'}] success [{'json': {'id': 'ORD-5488'}}] error [{'text': 'Error: ORD-5488 がありません'}] © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 例外も、status が error の 結果としてモデルに返る 29
  28. 4 ツールを⾃分で作る 成功とエラーを⾃分で返す custom_result.py の 9〜23 ⾏⽬ 出⼒ (1 ⾏⽬は

    28〜29 ⾏⽬) @tool def get_order(order_id: str) -> dict: """注⽂の中⾝を返す。 error [{'text': "Error:'ORD-9999'"}] 注⽂ID⾒つかりません。 もう⼀度確認お願いします。 Args: order_id: 注⽂の ID (例: ORD-5488) """ try: data = BOOK[order_id] return {"status": "success", "content": [{"json": data}]} except KeyError as e: text = f"Error:{e}" return {"status": "error", "content": [{"text": text}]} © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. try で status が success の dict を、except で error の dict を返す。無い番号を直接呼ぶと error が返り (1 ⾏⽬)、Agent は 確かめ直すよう答えた 30
  29. 4 ツールを⾃分で作る invocation_state で、プロンプトに⼊れない値を渡す state.py の 6〜20 ⾏⽬ 出⼒ @tool(context=True)

    def my_orders(tool_context: ToolContext) -> str: """サインイン中のお客さんの注⽂の数を返す。""" state = tool_context.invocation_state cid = state.get("customer_id") n = len(ORDERS.get(cid, [])) return f"{cid}: {n} 件" Tool #1: my_orders ご注⽂は2件です ありがとうございます prompt に C-1001: False agent = Agent(model=model, tools=[my_orders], system_prompt=PROMPT) agent("私の注⽂は何件ありますか", invocation_state={"customer_id": "C-1001"}) first = str(agent.messages[0]) print("\nprompt に C-1001:", "C-1001" in first) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. agent(..., invocation_state={...}) の値を、ツールの中で tool_context.invocation_state から読む。 最後の⾏: 頼みの⽂に C-1001 は⼊っていない 31
  30. 4 ツールを⾃分で作る 値をどこから渡すかの選び⽅ 渡し⽅ 向いている値 例 ツールの引数 モデルが頼みから考えて決める値 検索の語、ファイルのパス invocation_state

    呼び出しごとに変わり、 プロンプトに出さない値 利⽤者の ID、 session の ID クラス型のツール 変わらず、初期化が要る値 API キー、DB への接続 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
  31. 4 ツールを⾃分で作る クラスで台帳への接続を共有する class_tools.py の 6〜18 ⾏⽬ class_tools.py の 21〜29

    ⾏⽬ class OrderBook: def __init__(self, db): self.db = db # 台帳への接続のつもり book = OrderBook(ORDERS) tools = [book.count_orders, book.latest_order] agent = Agent(model=model, tools=tools, system_prompt=PROMPT, callback_handler=None) print(agent.tool_names) print(agent("C-1001 の注⽂の数と最新は")) @tool def count_orders(self, cid: str) -> int: """お客さんの注⽂の数を返す。""" return len(self.db.get(cid, [])) @tool def latest_order(self, cid: str) -> str: """いちばん新しい注⽂を返す。""" return self.db[cid][-1]["id"] 2 つのツールが同じ self.db を使う © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 出⼒ ['count_orders', 'latest_order'] 注⽂数は2件です。 最新はORD-5488です。 33
  32. 4 ツールを⾃分で作る async のツールは並⾏に呼ばれる async_tools.py の 16〜25 ⾏⽬ async_tools.py の

    28〜33 ⾏⽬ @tool async def ask_warehouse(item: str) -> str: """倉庫に在庫を問い合わせる。""" return await ask("倉庫") tools = [ask_warehouse, ask_shop] agent = Agent(model=model, tools=tools, system_prompt=PROMPT, callback_handler=None) asyncio.run(agent.invoke_async( "USB-C ハブを倉庫と店舗に同時に聞いて")) @tool async def ask_shop(item: str) -> str: """店舗に在庫を問い合わせる。""" return await ask("店舗") 1 回の応答で 2 つ要求され、2 秒の 出⼒ 3.8s start 倉庫 3.8s start 店舗 5.8s end 倉庫 5.8s end 店舗 問い合わせ 2 つが 2 秒で終わった © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 34
  33. まとめ まとめ 1 ツールは Agent(tools=[...]) に渡す。 ⾃作の @tool、付属のツール、MCPClient を同じリストに並べる 2

    MCP サーバーは MCPClient でつなぐ。 Agent に渡せば接続は⾃動。⾃分で管理するなら、呼ぶまで with の中 3 Streamable HTTP は url で渡す。 名前がぶつかるなら prefix、載せるツールを絞るなら tool_filters 4 ⾃作のツールは、docstring と型ヒントが仕様になる。 値は引数、invocation_state、クラスから渡す © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 35
  34. 付録 A1 どの⾯にも出る model と PROMPT d02/base.py # 02 の共通:

    モデル (東京の Bedrock) と指⽰の⽂ from agent import model # noqa: F401 PROMPT = """あなたはネットの家電のお店の問い合わせ窓⼝の係です。 記号の飾りを使わずに答える。答えは 2 ⽂まで。 1 ⽂は 20 字までにし、⽂ごとに改⾏する。 今⽇は 2026-11-10 です。""" agent.py の 19〜22 ⾏⽬ (01 で作った model) model = BedrockModel( model_id="global.anthropic.claude-sonnet-5", region_name="ap-northeast-1", # 東京 ) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. モデルを呼ぶ⾯は、 どれもこの model (東京の リージョンの Amazon Bedrock) と PROMPT を使う。 動かすには AWS の 資格情報が要る (01 で扱う) 37
  35. 付録 A2 ⼿元で動かした MCP サーバー delivery_server.py の 9〜11 ⾏⽬ 42〜43

    ⾏⽬ from mcp.server import MCPServer if __name__ == "__main__": mcp.run() # stdio mcp = MCPServer("宅配便の会社", log_level="WARNING") delivery_server.py の 20〜28 ⾏⽬ @mcp.tool() def get_delivery_status(order_id: str) -> str: """注⽂の荷物の配送の状況 (今どこか、いつ届くか) を返す。 Args: order_id: 注⽂の ID (例: ORD-5488) """ status = TRACKING.get(order_id) return status or f"{order_id} の荷物は⾒つかりません" © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. @mcp.tool() を付けた 関数がツールになり、 mcp.run() で stdio の サーバーとして動く 38
  36. 付録 A3 この資料で動かしたコード ファイル ⾯ ファイル ⾯ minimal.py 6 枚⽬

    iam_check.py 22 枚⽬ listing.py 9 枚⽬ two_servers.py 23 枚⽬ two_ways.py 10 枚⽬ collide.py 24 枚⽬ direct.py 11 枚⽬ filters.py 25 枚⽬ parallel.py 12、13 枚⽬ spec.py 27 枚⽬ delivery_server.py 16〜18、23〜25、38 枚⽬ results.py 29 枚⽬ mcp_min.py 16 枚⽬ custom_result.py 30 枚⽬ mcp_with.py 17 枚⽬ state.py 31 枚⽬ servers.py 17、18、23〜25 枚⽬ class_tools.py 33 枚⽬ mcp_outside.py 18 枚⽬ async_tools.py 34 枚⽬ mcp_http.py 21 枚⽬ base.py 37 枚⽬ stock_server.py 21、23 枚⽬ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 39
  37. 付録 出典: Strands Agents の公式ドキュメント 2026-11-10 に読んだ版 Tools: 4、6、7、35 枚⽬

    strandsagents.com/docs/user-guide/sdk/tools/ Attach and invoke tools: 7〜11 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/using-tools/ Vended tools: 8 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/vended-tools/ Tool executors: 12、13 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/executors/ Use MCP tools: 15〜19、23〜25、35 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/mcp-tools/ MCP transports: 4、15、19、21、22 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/mcp-transports/ Create custom tools: 27〜35 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/custom-tools/ Tool result format: 29、30 枚⽬ strandsagents.com/docs/user-guide/sdk/tools/tool-results/ 問い合わせ窓⼝のエージェントのコードと出⼒ (公開していない): 6、9〜13、16〜18、21〜25、27、29〜31、 33、34 枚⽬ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 40

More Decks by Riku INADA

Other Decks in Technology