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
fix: improve MCP tool prompt clarity to prevent format confusion
- Added explicit warnings about NOT using direct tool name format
- Added clear examples showing incorrect vs correct usage
- Emphasized the requirement to always use use_mcp_tool wrapper
- Updated MCP servers section to reinforce proper format
This should help prevent AI models from forgetting to wrap MCP tool
calls in the proper use_mcp_tool format, addressing issue #8507
Copy file name to clipboardExpand all lines: src/core/prompts/sections/mcp-servers.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,11 @@ The Model Context Protocol (MCP) enables communication between the system and MC
58
58
59
59
# Connected MCP Servers
60
60
61
-
When a server is connected, you can use the server's tools via the \`use_mcp_tool\` tool, and access the server's resources via the \`access_mcp_resource\` tool.
61
+
When a server is connected, you MUST use the server's tools via the \`use_mcp_tool\` wrapper, and access the server's resources via the \`access_mcp_resource\` wrapper.
62
+
63
+
**CRITICAL**: Never call MCP tools directly by their tool name. Always use the \`use_mcp_tool\` wrapper format:
Description: Request to use a tool provided by a connected MCP server. Each MCP server can provide multiple tools with different capabilities. Tools have defined input schemas that specify required and optional parameters.
9
+
10
+
**IMPORTANT**: You MUST always use the \`use_mcp_tool\` wrapper format shown below. Do NOT call MCP tools directly by their tool name.
11
+
9
12
Parameters:
10
13
- server_name: (required) The name of the MCP server providing the tool
11
14
- tool_name: (required) The name of the tool to execute
12
15
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
13
-
Usage:
16
+
17
+
Correct Usage Format:
14
18
<use_mcp_tool>
15
19
<server_name>server name here</server_name>
16
20
<tool_name>tool name here</tool_name>
17
21
<arguments>
18
22
{
19
-
"param1": "value1",
20
-
"param2": "value2"
23
+
"param1": "value1",
24
+
"param2": "value2"
21
25
}
22
26
</arguments>
23
27
</use_mcp_tool>
24
28
25
-
Example: Requesting to use an MCP tool
29
+
❌ INCORRECT - Do NOT use this format:
30
+
<get_pull_request>
31
+
<owner>username</owner>
32
+
<repo>repository</repo>
33
+
<pullNumber>123</pullNumber>
34
+
</get_pull_request>
35
+
36
+
✅ CORRECT - Always use this format:
37
+
<use_mcp_tool>
38
+
<server_name>github</server_name>
39
+
<tool_name>get_pull_request</tool_name>
40
+
<arguments>
41
+
{
42
+
"owner": "username",
43
+
"repo": "repository",
44
+
"pullNumber": 123
45
+
}
46
+
</arguments>
47
+
</use_mcp_tool>
48
+
49
+
Example: Using a weather MCP tool
26
50
27
51
<use_mcp_tool>
28
52
<server_name>weather-server</server_name>
29
53
<tool_name>get_forecast</tool_name>
30
54
<arguments>
31
55
{
32
-
"city": "San Francisco",
33
-
"days": 5
56
+
"city": "San Francisco",
57
+
"days": 5
34
58
}
35
59
</arguments>
36
-
</use_mcp_tool>`
60
+
</use_mcp_tool>
61
+
62
+
Remember: ALWAYS wrap MCP tool calls in the \`use_mcp_tool\` format, never call them directly by their tool name.`
0 commit comments