Skip to content

Commit 74f7678

Browse files
committed
Rename MCP tool parameters
1 parent e72349d commit 74f7678

2 files changed

Lines changed: 38 additions & 38 deletions

File tree

Public/Responses/Request-Response.ps1

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -159,28 +159,28 @@ function Request-Response {
159159

160160
#region Remote MCP
161161
[Parameter()]
162-
[switch]$UseMCP,
162+
[switch]$UseRemoteMCP,
163163

164164
[Parameter(DontShow)]
165-
[string]$MCPType = 'mcp', # Always 'mcp'
165+
[string]$RemoteMCPType = 'mcp', # Always 'mcp'
166166

167167
[Parameter()]
168168
[ValidateNotNullOrEmpty()]
169-
[string]$MCPServerLabel,
169+
[string]$RemoteMCPServerLabel,
170170

171171
[Parameter()]
172172
[ValidateNotNullOrEmpty()]
173-
[string]$MCPServerUrl,
173+
[string]$RemoteMCPServerUrl,
174174

175175
[Parameter()]
176-
[object]$MCPAllowedTools,
176+
[object]$RemoteMCPAllowedTools,
177177

178178
[Parameter()]
179179
[Completions('always', 'never')]
180-
[object]$MCPRequireApproval,
180+
[object]$RemoteMCPRequireApproval,
181181

182182
[Parameter()]
183-
[System.Collections.IDictionary]$MCPOptionalHeaders,
183+
[System.Collections.IDictionary]$RemoteMCPHeaders,
184184
#endregion Remote MCP
185185

186186
#region Code Interpreter
@@ -605,46 +605,46 @@ function Request-Response {
605605
}
606606

607607
#region Remote MCP
608-
if ($UseMCP) {
608+
if ($UseRemoteMCP) {
609609
# Server label and URL are required.
610-
if ([string]::IsNullOrWhiteSpace($MCPServerLabel)) {
611-
Write-Error 'MCPServerLabel must be specified.'
610+
if ([string]::IsNullOrWhiteSpace($RemoteMCPServerLabel)) {
611+
Write-Error 'RemoteMCPServerLabel must be specified.'
612612
}
613-
if ([string]::IsNullOrWhiteSpace($MCPServerUrl)) {
614-
Write-Error 'MCPServerUrl must be specified.'
613+
if ([string]::IsNullOrWhiteSpace($RemoteMCPServerUrl)) {
614+
Write-Error 'RemoteMCPServerUrl must be specified.'
615615
}
616616

617617
$MCPTool = @{
618-
type = $MCPType
619-
server_label = $MCPServerLabel
620-
server_url = $MCPServerUrl
618+
type = $RemoteMCPType
619+
server_label = $RemoteMCPServerLabel
620+
server_url = $RemoteMCPServerUrl
621621
}
622622

623-
if ($PSBoundParameters.ContainsKey('MCPAllowedTools')) {
624-
if ($MCPAllowedTools.tool_names.Count -gt 0) {
625-
$MCPAllowedTools = $MCPAllowedTools.tool_names
623+
if ($PSBoundParameters.ContainsKey('RemoteMCPAllowedTools')) {
624+
if ($RemoteMCPAllowedTools.tool_names.Count -gt 0) {
625+
$RemoteMCPAllowedTools = $RemoteMCPAllowedTools.tool_names
626626
}
627-
$MCPTool.allowed_tools = [string[]]$MCPAllowedTools
627+
$MCPTool.allowed_tools = [string[]]$RemoteMCPAllowedTools
628628
}
629-
if ($PSBoundParameters.ContainsKey('MCPRequireApproval')) {
630-
if ($MCPRequireApproval -is [string]) {
631-
$MCPTool.require_approval = $MCPRequireApproval.Trim()
629+
if ($PSBoundParameters.ContainsKey('RemoteMCPRequireApproval')) {
630+
if ($RemoteMCPRequireApproval -is [string]) {
631+
$MCPTool.require_approval = $RemoteMCPRequireApproval.Trim()
632632
}
633633
else {
634634
$MCPApprovalFilter = @{}
635-
if ($MCPRequireApproval.always.tool_names.Count -gt 0) {
636-
$MCPApprovalFilter.always = @{tool_names = [string[]]$MCPRequireApproval.always.tool_names }
635+
if ($RemoteMCPRequireApproval.always.tool_names.Count -gt 0) {
636+
$MCPApprovalFilter.always = @{tool_names = [string[]]$RemoteMCPRequireApproval.always.tool_names }
637637
}
638-
if ($MCPRequireApproval.never.tool_names.Count -gt 0) {
639-
$MCPApprovalFilter.never = @{tool_names = [string[]]$MCPRequireApproval.never.tool_names }
638+
if ($RemoteMCPRequireApproval.never.tool_names.Count -gt 0) {
639+
$MCPApprovalFilter.never = @{tool_names = [string[]]$RemoteMCPRequireApproval.never.tool_names }
640640
}
641641
if ($MCPApprovalFilter.Keys.Count -gt 0) {
642642
$MCPTool.require_approval = $MCPApprovalFilter
643643
}
644644
}
645645
}
646-
if ($MCPOptionalHeaders.Keys.Count -gt 0) {
647-
$MCPTool.headers = $MCPOptionalHeaders
646+
if ($RemoteMCPHeaders.Keys.Count -gt 0) {
647+
$MCPTool.headers = $RemoteMCPHeaders
648648
}
649649

650650
$Tools += $MCPTool

Tests/Responses/Request-Response.tests.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -829,20 +829,20 @@ Ping Source Address Latency(ms) BufferSize(B) Status
829829
It 'Tools - Remote MCP' {
830830
{
831831
$param = @{
832-
Message = 'How does microsoft/markitdown convert pptx to markdown?'
833-
Model = 'gpt-4.1-mini'
834-
UseMCP = $true
835-
MCPServerLabel = 'DeepWiki'
836-
MCPServerUrl = 'https://mcp.deepwiki.com/mcp'
837-
MCPRequireApproval = 'always'
838-
MCPOptionalHeaders = @{ 'X-Debug-Key' = '1234567890' } # Only for test, no meaning
839-
Store = $false
840-
TimeoutSec = 30
832+
Message = 'How does microsoft/markitdown convert pptx to markdown?'
833+
Model = 'gpt-4.1-mini'
834+
UseRemoteMCP = $true
835+
RemoteMCPServerLabel = 'DeepWiki'
836+
RemoteMCPServerUrl = 'https://mcp.deepwiki.com/mcp'
837+
RemoteMCPRequireApproval = 'always'
838+
RemoteMCPHeaders = @{ 'X-Debug-Key' = '1234567890' } # Only for test, no meaning
839+
Store = $false
840+
TimeoutSec = 30
841841
}
842842

843843
$script:Result = Request-Response @param -ea Stop } | Should -Not -Throw
844844
$Result.object | Should -Be 'response'
845-
$Result.LastUserMessage | Should -Be 'Check the latest OpenAI news on Google.'
845+
$Result.LastUserMessage | Should -Be 'How does microsoft/markitdown convert pptx to markdown?'
846846
$Result.output[-1].type | Should -Be 'mcp_approval_request'
847847
}
848848

0 commit comments

Comments
 (0)