Docs: local MCP require_approval callable form omitted from docs/mcp.md
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 87/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- documentation
Línea de trabajo
Lee la sección “Approval policies for local MCP servers” en docs/mcp.md y revisa el tipo de callable y el docstring del constructor en src/agents/mcp/server.py. Documenta la forma (run_context, agent, tool) -> bool | Awaitable[bool] e indica que tool es el Tool del MCP SDK con anotaciones, así como el comportamiento documentado cuando no hay ningún agente disponible. Se considera terminado cuando las formas admitidas y el comportamiento del callable estén claros en la documentación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 29.9k
- Forks
- 4.8k
- Merge medio
- 22 h 17 min
- PR fusionados (30 d)
- 208
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openai/openai-agents-python
-
SandboxApplyPatchTool splits patch lines with str.splitlines(), so a form feed or in a line breaks Add/Update FilePosiblemente ocupada @abhishekacharya200 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openai/openai-agents-python#5349 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
openai/openai-agents-python#5348 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Support the OpenAI Decisions APIAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
openai/openai-agents-python#5353 ·
Los mantenedores suelen responder en 1 día
-
RunState round trip drops alias-only fields: `"async": null` on a function call is serialized as `async_` and breaks `get_interruptions()` on restorePosiblemente ocupada @iveteamorim la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
openai/openai-agents-python#5352 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
openai/openai-agents-python#5351 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de openai/openai-agents-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/peft#3955 ·
Los mantenedores suelen responder en 1 día
-
author-page correction
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
acl-org/acl-anthology#10313 ·
Los mantenedores suelen responder en 1 día
-
anime duplicate exception request-theme
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
LizardByte/ThemerrDB#8926 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
huggingface/transformers#49556 ·
Los mantenedores suelen responder en 1 día
-
area/security bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mozilla-ai/otari#2245 ·
Los mantenedores suelen responder en 1 día