Michael Bolin and GitHub
be5afc65d3
codex-tools: extract MCP schema adapters ( #15928 )
...
## Why
`codex-tools` already owns the shared tool input schema model and parser
from the first extraction step, but `core/src/tools/spec.rs` still owned
the MCP-specific adapter that normalizes `rmcp::model::Tool` schemas and
wraps `structuredContent` into the call result output schema.
Keeping that adapter in `codex-core` means the reusable MCP schema path
is still split across crates, and the unit tests for that logic stay
anchored in `codex-core` even though the runtime orchestration does not
need to move yet.
This change takes the next small step by moving the reusable MCP schema
adapter into `codex-tools` while leaving `ResponsesApiTool` assembly in
`codex-core`.
## What changed
- added `tools/src/mcp_tool.rs` and sibling
`tools/src/mcp_tool_tests.rs`
- introduced `ParsedMcpTool`, `parse_mcp_tool()`, and
`mcp_call_tool_result_output_schema()` in `codex-tools`
- updated `core/src/tools/spec.rs` to consume parsed MCP tool parts from
`codex-tools`
- removed the now-redundant MCP schema unit tests from
`core/src/tools/spec_tests.rs`
- expanded `codex-rs/tools/README.md` to describe this second migration
step
## Test plan
- `cargo test -p codex-tools`
- `cargo test -p codex-core --lib tools::spec::`
2026-03-26 19:57:26 -07:00
..
2026-03-26 18:57:34 +01:00
2026-03-25 12:26:02 -07:00
2026-01-13 10:22:51 -08:00
2026-03-25 16:02:22 +00:00
2026-03-26 17:12:45 -07:00
2026-03-25 12:57:42 -07:00
2026-03-24 18:34:44 -07:00
2026-03-25 16:02:22 +00:00
2026-03-25 12:57:42 -07:00
2026-03-26 19:33:23 +00:00
2026-03-26 10:33:25 +01:00
2026-03-24 15:45:40 -07:00
2026-03-26 15:53:22 +00:00
2026-03-24 22:54:18 -07:00
2026-03-24 18:34:44 -07:00
2026-03-26 07:46:04 -07:00
2026-03-25 16:02:22 +00:00
2026-03-26 19:57:26 -07:00
2026-03-26 16:45:36 +01:00
2026-03-24 18:10:53 -07:00
2026-03-14 15:38:51 -07:00
2026-03-26 13:34:02 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-20 21:13:20 +00:00
2026-03-20 21:13:20 +00:00
2026-03-17 15:24:37 -07:00
2026-03-18 09:37:13 -07:00
2026-03-18 09:37:13 -07:00
2026-03-17 19:46:44 -07:00
2026-03-19 18:58:17 -07:00
2026-03-26 15:32:03 -07:00
2026-03-26 15:32:03 -07:00
2026-03-26 17:12:45 -07:00
2026-03-26 16:06:53 -04:00
2026-03-26 16:06:53 -04:00
2026-03-26 15:32:03 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 10:53:08 -07:00
2026-03-12 08:16:36 -07:00
2026-03-24 15:45:40 -07:00
2026-03-19 20:12:07 -07:00
2026-03-26 13:34:02 -07:00
2026-03-12 00:35:21 -07:00
2026-03-25 10:43:49 -07:00
2026-03-25 10:43:49 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 18:58:17 -07:00
2026-03-12 08:16:36 -07:00
2026-03-25 16:02:22 +00:00
2026-03-14 15:38:51 -07:00
2026-03-26 13:34:02 -07:00
2026-03-23 18:53:54 +00:00
2026-03-24 12:43:53 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-26 17:12:45 -07:00
2026-03-21 01:28:25 +00:00
2026-03-26 16:06:53 -04:00
2026-03-26 17:27:38 -07:00
2026-03-12 08:16:36 -07:00
2026-03-16 16:48:15 -07:00
2026-03-24 11:04:47 -07:00
2026-03-24 11:04:47 -07:00
2025-09-24 14:29:51 -07:00
2026-01-08 15:07:30 +00:00
2026-03-24 13:26:23 -07:00
2026-03-25 19:18:03 -07:00
2026-03-25 23:51:39 -07:00
2026-03-27 00:03:35 +00:00
2026-03-26 01:02:37 +00:00
2026-03-24 23:32:31 +00:00
2026-03-15 23:15:52 -07:00
2026-03-26 01:02:37 +00:00
2026-03-26 17:08:02 +00:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-25 11:05:35 -07:00
2026-03-12 08:16:36 -07:00
2026-03-18 11:54:11 -06:00
2026-03-17 10:07:46 -07:00
2026-03-17 10:07:46 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-16 16:48:15 -07:00
2026-03-19 20:12:07 -07:00
2026-03-19 20:12:07 -07:00
2026-03-19 20:12:07 -07:00
2026-03-20 18:23:48 +00:00
2026-03-16 16:48:15 -07:00
2026-03-25 16:02:22 +00:00
2026-03-25 16:02:22 +00:00
2026-03-20 18:23:48 +00:00
2026-03-24 15:45:40 -07:00
2026-03-16 21:38:07 -07:00
2026-03-17 21:04:58 -07:00
2026-03-14 15:38:51 -07:00
2026-03-16 16:48:15 -07:00
2026-03-24 13:26:23 -07:00
2026-03-24 18:10:53 -07:00
2026-03-26 16:06:53 -04:00
2026-03-24 08:20:57 -07:00
2026-03-24 08:20:57 -07:00
2026-03-24 08:20:57 -07:00
2026-03-26 17:12:45 -07:00
2026-03-20 18:23:48 +00:00
2026-03-24 18:10:53 -07:00
2026-03-17 10:07:46 -07:00
2026-02-10 17:03:46 -08:00
2026-03-17 17:59:27 +00:00
2026-03-17 17:59:27 +00:00
2026-03-12 08:16:36 -07:00
2026-03-16 16:48:15 -07:00
2026-03-25 12:57:42 -07:00
2026-03-25 12:57:42 -07:00
2026-03-07 02:30:21 +00:00
2026-03-24 18:10:53 -07:00
2026-03-19 15:16:26 -07:00
2026-03-19 22:57:16 -07:00
2026-03-25 16:14:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-25 16:14:36 -07:00
2026-03-25 16:14:36 -07:00
2026-03-24 18:10:53 -07:00
2026-03-24 18:10:53 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 22:05:13 +00:00
2026-03-24 13:26:23 -07:00
2026-03-18 10:03:38 +00:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 18:58:17 -07:00
2026-03-19 18:58:17 -07:00
2026-01-30 16:37:56 -08:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 20:12:07 -07:00
2026-03-26 17:27:38 -07:00