mirror of
https://github.com/openai/codex.git
synced 2026-09-16 12:13:30 +00:00
tool name update
This commit is contained in:
@@ -1774,7 +1774,7 @@ mod tests {
|
||||
call_id: "call_123".to_string(),
|
||||
invocation: McpInvocation {
|
||||
server: "codex".to_string(),
|
||||
tool: "list_mcp_resources".to_string(),
|
||||
tool: "mcp_list_resources".to_string(),
|
||||
arguments: Some(serde_json::json!({"server": ""})),
|
||||
},
|
||||
};
|
||||
@@ -1932,7 +1932,7 @@ mod tests {
|
||||
call_id: "call_456".to_string(),
|
||||
invocation: McpInvocation {
|
||||
server: "codex".to_string(),
|
||||
tool: "list_mcp_resources".to_string(),
|
||||
tool: "mcp_list_resources".to_string(),
|
||||
arguments: None,
|
||||
},
|
||||
};
|
||||
@@ -1981,7 +1981,7 @@ mod tests {
|
||||
call_id: "call_789".to_string(),
|
||||
invocation: McpInvocation {
|
||||
server: "codex".to_string(),
|
||||
tool: "list_mcp_resources".to_string(),
|
||||
tool: "mcp_list_resources".to_string(),
|
||||
arguments: Some(serde_json::json!({"server": ""})),
|
||||
},
|
||||
duration: Duration::from_nanos(92708),
|
||||
@@ -2024,7 +2024,7 @@ mod tests {
|
||||
call_id: "call_err".to_string(),
|
||||
invocation: McpInvocation {
|
||||
server: "codex".to_string(),
|
||||
tool: "list_mcp_resources".to_string(),
|
||||
tool: "mcp_list_resources".to_string(),
|
||||
arguments: None,
|
||||
},
|
||||
duration: Duration::from_millis(1),
|
||||
|
||||
@@ -81,4 +81,4 @@ You are producing plain text that will later be styled by the CLI. Follow these
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
@@ -81,4 +81,4 @@ You are producing plain text that will later be styled by the CLI. Follow these
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
@@ -332,4 +332,4 @@ If all steps are complete, ensure you call `update_plan` to mark all steps as `c
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
@@ -299,4 +299,4 @@ If all steps are complete, ensure you call `update_plan` to mark all steps as `c
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
@@ -69,4 +69,4 @@ You are producing plain text that will later be styled by the CLI. Follow these
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
@@ -276,4 +276,4 @@ If all steps are complete, ensure you call `update_plan` to mark all steps as `c
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
@@ -276,7 +276,7 @@ If all steps are complete, ensure you call `update_plan` to mark all steps as `c
|
||||
|
||||
## MCP servers
|
||||
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `list_mcp_resources` (and resource templates via `list_mcp_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
MCP servers are accessed via tool calls. MCP tools are provided in the form `mcp__{server_name}__{tool_name}`. When asked what MCPs are available, check the tools with the `mcp__` prefix and report the inferred server names. MCP resources can be enumerated via `mcp_list_resources` (and resource templates via `mcp_list_resource_templates`) and you should include any server descriptions exposed in tool metadata when available.
|
||||
|
||||
## `apply_patch`
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ impl ToolHandler for McpResourceHandler {
|
||||
let arguments_value = parse_arguments(arguments.as_str())?;
|
||||
|
||||
match tool_name.as_str() {
|
||||
"list_mcp_resources" => {
|
||||
"mcp_list_resources" => {
|
||||
handle_list_resources(
|
||||
Arc::clone(&session),
|
||||
Arc::clone(&turn),
|
||||
@@ -217,7 +217,7 @@ impl ToolHandler for McpResourceHandler {
|
||||
)
|
||||
.await
|
||||
}
|
||||
"list_mcp_resource_templates" => {
|
||||
"mcp_list_resource_templates" => {
|
||||
handle_list_resource_templates(
|
||||
Arc::clone(&session),
|
||||
Arc::clone(&turn),
|
||||
@@ -255,7 +255,7 @@ async fn handle_list_resources(
|
||||
|
||||
let invocation = McpInvocation {
|
||||
server: server.clone().unwrap_or_else(|| "codex".to_string()),
|
||||
tool: "list_mcp_resources".to_string(),
|
||||
tool: "mcp_list_resources".to_string(),
|
||||
arguments: arguments.clone(),
|
||||
};
|
||||
|
||||
@@ -362,7 +362,7 @@ async fn handle_list_resource_templates(
|
||||
|
||||
let invocation = McpInvocation {
|
||||
server: server.clone().unwrap_or_else(|| "codex".to_string()),
|
||||
tool: "list_mcp_resource_templates".to_string(),
|
||||
tool: "mcp_list_resource_templates".to_string(),
|
||||
arguments: arguments.clone(),
|
||||
};
|
||||
|
||||
|
||||
@@ -790,7 +790,7 @@ fn create_list_dir_tool() -> ToolSpec {
|
||||
})
|
||||
}
|
||||
|
||||
fn create_list_mcp_resources_tool() -> ToolSpec {
|
||||
fn create_mcp_list_resources_tool() -> ToolSpec {
|
||||
let properties = BTreeMap::from([
|
||||
(
|
||||
"server".to_string(),
|
||||
@@ -805,7 +805,7 @@ fn create_list_mcp_resources_tool() -> ToolSpec {
|
||||
"cursor".to_string(),
|
||||
JsonSchema::String {
|
||||
description: Some(
|
||||
"Opaque cursor returned by a previous list_mcp_resources call for the same server."
|
||||
"Opaque cursor returned by a previous mcp_list_resources call for the same server."
|
||||
.to_string(),
|
||||
),
|
||||
},
|
||||
@@ -813,7 +813,7 @@ fn create_list_mcp_resources_tool() -> ToolSpec {
|
||||
]);
|
||||
|
||||
ToolSpec::Function(ResponsesApiTool {
|
||||
name: "list_mcp_resources".to_string(),
|
||||
name: "mcp_list_resources".to_string(),
|
||||
description: "Lists resources provided by MCP servers. Resources allow servers to share data that provides context to language models, such as files, database schemas, or application-specific information. Prefer resources over web search when possible.".to_string(),
|
||||
strict: false,
|
||||
parameters: JsonSchema::Object {
|
||||
@@ -824,7 +824,7 @@ fn create_list_mcp_resources_tool() -> ToolSpec {
|
||||
})
|
||||
}
|
||||
|
||||
fn create_list_mcp_resource_templates_tool() -> ToolSpec {
|
||||
fn create_mcp_list_resource_templates_tool() -> ToolSpec {
|
||||
let properties = BTreeMap::from([
|
||||
(
|
||||
"server".to_string(),
|
||||
@@ -839,7 +839,7 @@ fn create_list_mcp_resource_templates_tool() -> ToolSpec {
|
||||
"cursor".to_string(),
|
||||
JsonSchema::String {
|
||||
description: Some(
|
||||
"Opaque cursor returned by a previous list_mcp_resource_templates call for the same server."
|
||||
"Opaque cursor returned by a previous mcp_list_resource_templates call for the same server."
|
||||
.to_string(),
|
||||
),
|
||||
},
|
||||
@@ -847,7 +847,7 @@ fn create_list_mcp_resource_templates_tool() -> ToolSpec {
|
||||
]);
|
||||
|
||||
ToolSpec::Function(ResponsesApiTool {
|
||||
name: "list_mcp_resource_templates".to_string(),
|
||||
name: "mcp_list_resource_templates".to_string(),
|
||||
description: "Lists resource templates provided by MCP servers. Parameterized resource templates allow servers to share data that takes parameters and provides context to language models, such as files, database schemas, or application-specific information. Prefer resource templates over web search when possible.".to_string(),
|
||||
strict: false,
|
||||
parameters: JsonSchema::Object {
|
||||
@@ -864,7 +864,7 @@ fn create_read_mcp_resource_tool() -> ToolSpec {
|
||||
"server".to_string(),
|
||||
JsonSchema::String {
|
||||
description: Some(
|
||||
"MCP server name exactly as configured. Must match the 'server' field returned by list_mcp_resources."
|
||||
"MCP server name exactly as configured. Must match the 'server' field returned by mcp_list_resources."
|
||||
.to_string(),
|
||||
),
|
||||
},
|
||||
@@ -873,7 +873,7 @@ fn create_read_mcp_resource_tool() -> ToolSpec {
|
||||
"uri".to_string(),
|
||||
JsonSchema::String {
|
||||
description: Some(
|
||||
"Resource URI to read. Must be one of the URIs returned by list_mcp_resources."
|
||||
"Resource URI to read. Must be one of the URIs returned by mcp_list_resources."
|
||||
.to_string(),
|
||||
),
|
||||
},
|
||||
@@ -1157,11 +1157,11 @@ pub(crate) fn build_specs(
|
||||
builder.register_handler("shell_command", shell_command_handler);
|
||||
}
|
||||
|
||||
builder.push_spec_with_parallel_support(create_list_mcp_resources_tool(), true);
|
||||
builder.push_spec_with_parallel_support(create_list_mcp_resource_templates_tool(), true);
|
||||
builder.push_spec_with_parallel_support(create_mcp_list_resources_tool(), true);
|
||||
builder.push_spec_with_parallel_support(create_mcp_list_resource_templates_tool(), true);
|
||||
builder.push_spec_with_parallel_support(create_read_mcp_resource_tool(), true);
|
||||
builder.register_handler("list_mcp_resources", mcp_resource_handler.clone());
|
||||
builder.register_handler("list_mcp_resource_templates", mcp_resource_handler.clone());
|
||||
builder.register_handler("mcp_list_resources", mcp_resource_handler.clone());
|
||||
builder.register_handler("mcp_list_resource_templates", mcp_resource_handler.clone());
|
||||
builder.register_handler("read_mcp_resource", mcp_resource_handler);
|
||||
|
||||
builder.push_spec(PLAN_TOOL.clone());
|
||||
@@ -1393,8 +1393,8 @@ mod tests {
|
||||
for spec in [
|
||||
create_exec_command_tool(),
|
||||
create_write_stdin_tool(),
|
||||
create_list_mcp_resources_tool(),
|
||||
create_list_mcp_resource_templates_tool(),
|
||||
create_mcp_list_resources_tool(),
|
||||
create_mcp_list_resource_templates_tool(),
|
||||
create_read_mcp_resource_tool(),
|
||||
PLAN_TOOL.clone(),
|
||||
create_apply_patch_freeform_tool(),
|
||||
@@ -1502,8 +1502,8 @@ mod tests {
|
||||
&Features::with_defaults(),
|
||||
&[
|
||||
"shell_command",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1519,8 +1519,8 @@ mod tests {
|
||||
&Features::with_defaults(),
|
||||
&[
|
||||
"shell_command",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1539,8 +1539,8 @@ mod tests {
|
||||
&[
|
||||
"exec_command",
|
||||
"write_stdin",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1560,8 +1560,8 @@ mod tests {
|
||||
&[
|
||||
"exec_command",
|
||||
"write_stdin",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1578,8 +1578,8 @@ mod tests {
|
||||
&Features::with_defaults(),
|
||||
&[
|
||||
"local_shell",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"view_image",
|
||||
@@ -1594,8 +1594,8 @@ mod tests {
|
||||
&Features::with_defaults(),
|
||||
&[
|
||||
"shell_command",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1611,8 +1611,8 @@ mod tests {
|
||||
&Features::with_defaults(),
|
||||
&[
|
||||
"shell",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"view_image",
|
||||
@@ -1627,8 +1627,8 @@ mod tests {
|
||||
&Features::with_defaults(),
|
||||
&[
|
||||
"shell_command",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1645,8 +1645,8 @@ mod tests {
|
||||
&[
|
||||
"exec_command",
|
||||
"write_stdin",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
@@ -1665,8 +1665,8 @@ mod tests {
|
||||
&[
|
||||
"exec_command",
|
||||
"write_stdin",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"web_search",
|
||||
|
||||
@@ -54,8 +54,8 @@ async fn model_selects_expected_tools() {
|
||||
codex_tools,
|
||||
vec![
|
||||
"local_shell".to_string(),
|
||||
"list_mcp_resources".to_string(),
|
||||
"list_mcp_resource_templates".to_string(),
|
||||
"mcp_list_resources".to_string(),
|
||||
"mcp_list_resource_templates".to_string(),
|
||||
"read_mcp_resource".to_string(),
|
||||
"update_plan".to_string(),
|
||||
"view_image".to_string()
|
||||
@@ -68,8 +68,8 @@ async fn model_selects_expected_tools() {
|
||||
gpt5_codex_tools,
|
||||
vec![
|
||||
"shell_command".to_string(),
|
||||
"list_mcp_resources".to_string(),
|
||||
"list_mcp_resource_templates".to_string(),
|
||||
"mcp_list_resources".to_string(),
|
||||
"mcp_list_resource_templates".to_string(),
|
||||
"read_mcp_resource".to_string(),
|
||||
"update_plan".to_string(),
|
||||
"apply_patch".to_string(),
|
||||
@@ -83,8 +83,8 @@ async fn model_selects_expected_tools() {
|
||||
gpt51_codex_tools,
|
||||
vec![
|
||||
"shell_command".to_string(),
|
||||
"list_mcp_resources".to_string(),
|
||||
"list_mcp_resource_templates".to_string(),
|
||||
"mcp_list_resources".to_string(),
|
||||
"mcp_list_resource_templates".to_string(),
|
||||
"read_mcp_resource".to_string(),
|
||||
"update_plan".to_string(),
|
||||
"apply_patch".to_string(),
|
||||
@@ -98,8 +98,8 @@ async fn model_selects_expected_tools() {
|
||||
gpt5_tools,
|
||||
vec![
|
||||
"shell".to_string(),
|
||||
"list_mcp_resources".to_string(),
|
||||
"list_mcp_resource_templates".to_string(),
|
||||
"mcp_list_resources".to_string(),
|
||||
"mcp_list_resource_templates".to_string(),
|
||||
"read_mcp_resource".to_string(),
|
||||
"update_plan".to_string(),
|
||||
"view_image".to_string()
|
||||
@@ -112,8 +112,8 @@ async fn model_selects_expected_tools() {
|
||||
gpt51_tools,
|
||||
vec![
|
||||
"shell_command".to_string(),
|
||||
"list_mcp_resources".to_string(),
|
||||
"list_mcp_resource_templates".to_string(),
|
||||
"mcp_list_resources".to_string(),
|
||||
"mcp_list_resource_templates".to_string(),
|
||||
"read_mcp_resource".to_string(),
|
||||
"update_plan".to_string(),
|
||||
"apply_patch".to_string(),
|
||||
@@ -127,8 +127,8 @@ async fn model_selects_expected_tools() {
|
||||
vec![
|
||||
"exec_command".to_string(),
|
||||
"write_stdin".to_string(),
|
||||
"list_mcp_resources".to_string(),
|
||||
"list_mcp_resource_templates".to_string(),
|
||||
"mcp_list_resources".to_string(),
|
||||
"mcp_list_resource_templates".to_string(),
|
||||
"read_mcp_resource".to_string(),
|
||||
"update_plan".to_string(),
|
||||
"apply_patch".to_string(),
|
||||
|
||||
@@ -117,8 +117,8 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> {
|
||||
|
||||
let expected_tools_names = vec![
|
||||
"shell_command",
|
||||
"list_mcp_resources",
|
||||
"list_mcp_resource_templates",
|
||||
"mcp_list_resources",
|
||||
"mcp_list_resource_templates",
|
||||
"read_mcp_resource",
|
||||
"update_plan",
|
||||
"apply_patch",
|
||||
|
||||
Reference in New Issue
Block a user