You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mcp.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,8 @@ agent = Agent(
40
40
# If None, MCP tool failures are raised as exceptions instead of
41
41
# returning model-visible error text.
42
42
"failure_error_function": None,
43
+
# Prefix local MCP tool names with their server name.
44
+
"include_server_in_tool_names": True,
43
45
},
44
46
)
45
47
```
@@ -50,6 +52,7 @@ Notes:
50
52
-`failure_error_function` controls how MCP tool call failures are surfaced to the model.
51
53
- When `failure_error_function` is unset, the SDK uses the default tool error formatter.
52
54
- Server-level `failure_error_function` overrides `Agent.mcp_config["failure_error_function"]` for that server.
55
+
-`include_server_in_tool_names` is opt-in. When enabled, each local MCP tool is exposed to the model with a deterministic server-prefixed name, which helps avoid collisions when multiple MCP servers publish tools with the same name. Generated names are ASCII-safe, stay within the function-tool name length limit, and avoid existing local function tool and enabled handoff names on the same agent. The SDK still invokes the original MCP tool name on the original server.
0 commit comments