Use MCP server instructions in deferred namespace descriptions#21053
Merged
Conversation
7b8475a to
7bc4811
Compare
7bc4811 to
32ff683
Compare
pakrym-oai
reviewed
May 4, 2026
| } | ||
|
|
||
| pub fn namespace_description(&self) -> Option<&str> { | ||
| self.connector_description |
Collaborator
There was a problem hiding this comment.
is connector_description used in any other interesting way? can we have one fied?
Collaborator
Author
There was a problem hiding this comment.
fair, i think we can
pakrym-oai
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MCP servers can provide
instructionsthat explain what their tools are for. Directly exposed MCP namespaces already use those instructions when a connector description is not available, but deferredtool_searchresults did not preserve that fallback. The direct path falls back from connector metadata to server instructions, while the deferred path only carriedconnector_descriptionand otherwise fell back to generic namespace text.That meant a plain MCP server could provide useful model-facing guidance and still appear as
Tools in the X namespace.whenever it was discovered lazily throughtool_search.What changed
namespace_descriptiononToolInfo, using connector descriptions for connector-backed tools and server instructions for plain MCP servers.tool_searchsource list, search indexing, and returned namespace metadata.Verification
cargo test -p codex-tools search_tool_description_lists_each_mcp_source_once --libcargo test -p codex-core --test all tool_search_uses_non_app_mcp_server_instructions_as_namespace_description