Skip to content

Commit 9266cf4

Browse files
syedkazmi14copilot-swe-agent[bot]Copilot
authored
Document MCP tool filter naming across SDKs (#2101)
* Document and normalize MCP tool filter names * Normalize Python MCP tool filter aliases * Document MCP tool filter naming across SDKs * Revert to README-only documentation for MCP tool filter naming Removes source-file doc-comment/docstring/Javadoc/XML-doc edits added alongside the README updates, keeping only the README changes that document the <server-key>-<tool-name> MCP tool naming convention across all 6 SDKs, per review feedback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <copilot-swe-agent[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 95ba623 commit 9266cf4

6 files changed

Lines changed: 32 additions & 0 deletions

File tree

dotnet/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ await session.SendAsync(new MessageOptions { Prompt = "What is 2+2?" });
6464
await done.Task;
6565
```
6666

67+
When targeting MCP tools configured through `McpServers`, remember the runtime
68+
tool name is `<server-key>-<tool-name>`. For `AvailableTools` and
69+
`ExcludedTools`, prefer the source-qualified form
70+
`mcp:<server-key>-<tool-name>`. For `CustomAgents[].Tools` and
71+
`DefaultAgent.ExcludedTools`, use `<server-key>-<tool-name>` directly.
72+
6773
## API Reference
6874

6975
### CopilotClient

go/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ func main() {
8989
}
9090
```
9191

92+
When targeting MCP tools configured through `MCPServers`, remember the runtime
93+
tool name is `<server-key>-<tool-name>`. For `AvailableTools` and
94+
`ExcludedTools`, prefer the source-qualified form
95+
`mcp:<server-key>-<tool-name>`. For `CustomAgents[].Tools` and
96+
`DefaultAgent.ExcludedTools`, use `<server-key>-<tool-name>` directly.
97+
9298
## Distributing your application with an embedded GitHub Copilot CLI
9399

94100
The SDK supports bundling, using Go's `embed` package, the Copilot CLI binary within your application's distribution.

java/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ public class CopilotSDK {
120120
}
121121
```
122122

123+
When targeting MCP tools configured through `setMcpServers(...)`, remember the
124+
runtime tool name is `<server-key>-<tool-name>`. For `setAvailableTools(...)`
125+
and `setExcludedTools(...)`, prefer the source-qualified filter form
126+
`mcp:<server-key>-<tool-name>`. For `CustomAgentConfig.setTools(...)` and
127+
`DefaultAgentConfig.setExcludedTools(...)`, use `<server-key>-<tool-name>`
128+
directly.
129+
123130
## Try it with JBang
124131

125132
You can run the SDK without setting up a full Java project, by using [JBang](https://www.jbang.dev/).

nodejs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ await using session = await client.createSession({
7171
// session is automatically disconnected when leaving scope
7272
```
7373

74+
When targeting MCP tools configured through `mcpServers`, remember the runtime
75+
tool name is `<server-key>-<tool-name>`. For `availableTools` and
76+
`excludedTools`, prefer `new ToolSet().addMcp("<server-key>-<tool-name>")` or
77+
the raw `mcp:<server-key>-<tool-name>` form. For `customAgents[].tools` and
78+
`defaultAgent.excludedTools`, use `<server-key>-<tool-name>` directly.
79+
7480
## API Reference
7581

7682
### CopilotClient

python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ These are passed as keyword arguments to `create_session()`:
282282
- `on_permission_request` (callable): Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. Use `PermissionHandler.approve_all` to allow everything, or provide a custom function for fine-grained control. See [Permission Handling](#permission-handling) section.
283283
- `on_user_input_request` (callable): Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
284284
- `hooks` (SessionHooks): Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
285+
- `available_tools` / `excluded_tools` / `default_agent.excluded_tools` / custom-agent `tools`: MCP tools registered from `mcp_servers` are exposed to the runtime as `<server-key>-<tool-name>`. For `available_tools` and `excluded_tools`, prefer `ToolSet().add_mcp("<server-key>-<tool-name>")` or the raw `mcp:<server-key>-<tool-name>` form. For custom-agent `tools` and `default_agent.excluded_tools`, use `<server-key>-<tool-name>` directly.
285286

286287
**Session Lifecycle Methods:**
287288

rust/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ client.stop().await.ok();
3131
# }
3232
```
3333

34+
When targeting MCP tools configured through `mcp_servers`, remember the runtime
35+
tool name is `<server-key>-<tool-name>`. For `available_tools` and
36+
`excluded_tools`, prefer `ToolSet::new().add_mcp("<server-key>-<tool-name>")`
37+
or the raw `mcp:<server-key>-<tool-name>` form. For `custom_agents[].tools`
38+
and `default_agent.excluded_tools`, use `<server-key>-<tool-name>` directly.
39+
3440
## Architecture
3541

3642
```text

0 commit comments

Comments
 (0)