Docs: local MCP require_approval callable form omitted from docs/mcp.md
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 87/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
docs/mcp.md の「Approval policies for local MCP servers」セクションを読み、src/agents/mcp/server.py の callable 型とコンストラクターの docstring を確認します。(run_context, agent, tool) -> bool | Awaitable[bool] の形式を文書化し、tool はアノテーション付きの MCP SDK の Tool であることと、エージェントが利用できない場合の文書化された動作を明記します。対応する形式と callable の動作がドキュメントで明確になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Please read this first
- Have you read the docs? Yes — MCP docs and Human-in-the-loop
- Have you searched for related issues? Yes. #5315 asks to expose MCP
ToolAnnotationson convertedFunctionToolfor hooks. This issue is separate: the callablerequire_approvalpolicy that already receives the original MCPTool(including annotations) is implemented but not documented indocs/mcp.md.
Describe the docs gap
docs/mcp.md → Approval policies for local MCP servers lists these supported forms for require_approval on MCPServerStdio / MCPServerSse / MCPServerStreamableHttp:
"always"/"never"True/False- per-tool map
- grouped
{always, never}object
It omits the callable form that the public type and constructor docstring already accept.
Exact doc path
docs/mcp.md— section starting at “Approval policies for local MCP servers” (Supported forms list)- Cross-link:
docs/human_in_the_loop.mdmentions local MCPrequire_approvalbut does not show the callable signature either - Examples under
examples/mcp/only demonstrate string/dict policies (get_all_mcp_tools_example,tool_filter_example)
Evidence in source (current main)
Type alias in src/agents/mcp/server.py:
LocalMCPApprovalCallable = Callable[
[RunContextWrapper[Any], "AgentBase", MCPTool],
MaybeAwaitable[bool],
]
Constructor docstring on MCPServer:
Accepts
"always"/"never", a dict of tool names to those values, a boolean, an object with always/never tool lists … or a sync/async callable that receives(run_context, agent, tool)and returns whether the tool call needs approval.
_normalize_needs_approval accepts callables, and _get_needs_approval_for_tool invokes policy(run_context, agent, tool) with the original MCP Tool — so callers can read tool.annotations (e.g. destructiveHint / readOnlyHint) without a parallel list_tools() cache.
Minimal illustration of the undocumented form
from mcp.types import Tool
from agents.mcp import MCPServerStreamableHttp
def approve_destructive(run_context, agent, tool: Tool) -> bool:
hints = tool.annotations
# Require HITL when the server marks the tool destructive (or omits read-only).
if hints and hints.read_only_hint:
return False
return bool(hints is None or hints.destructive_hint is not False)
server = MCPServerStreamableHttp(
name="crm",
params={"url": "http://localhost:8000/mcp"},
require_approval=approve_destructive, # valid API; missing from docs/mcp.md Supported forms
)
Expected docs change
- Add the callable form to the Supported forms list in
docs/mcp.md, with the signature(run_context, agent, tool) -> bool | Awaitable[bool]and a note thattoolis the MCP SDKTool(annotations available). - Optionally add a short example next to the existing dict example, and/or one line in
docs/human_in_the_loop.mdpointing at it. - Note the fail-closed behavior when a callable policy is used without an agent (documented in
_get_needs_approval_for_tool).
Happy to refine wording if maintainers prefer a different example shape. Because this repo accepts issues (not external PRs) for docs, filing here rather than opening a PR.
- 主要言語
- Python
- スター
- 30k
- フォーク
- 4.9k
- 平均マージ
- 18時間 13分
- マージ済み PR(30日)
- 215
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-agents-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
openai/openai-agents-python#5348 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
openai/openai-agents-python#5353 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 70/100
openai/openai-agents-python#5342 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
openai/openai-agents-python#5336 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Finished tool call is dropped when a parallel tool's guardrail trips対応中かも @jbeckwith-oai が 7 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
openai/openai-agents-python#5327 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
openai/openai-agents-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Deltares/imod-python#1940 ·
メンテナーはふだん 1 日以内に返信
-
effort: low prio: low ready
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
digitalfabrik/integreat-cms#4621 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ioos/compliance-checker#1375 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信