Skip to content

fix(client): align the E2B search_tools helper with searchTools() - #2965

Open
BlueX888 wants to merge 1 commit into
mcp-use:mainfrom
BlueX888:fix/code-mode-e2b-search-tools-parity
Open

BlueX888 wants to merge 1 commit into
mcp-use:mainfrom
BlueX888:fix/code-mode-e2b-search-tools-parity

Conversation

@BlueX888

@BlueX888 BlueX888 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Description

Where did you find this issue?

Code mode has two executors (local VM and E2B) and a documented discovery helper, search_tools(). The VM executor and the searchTools() API return a ToolSearchResponse:

{ meta: { total_tools: number; namespaces: string[]; result_count: number }, results: ToolSearchResult[] }

The E2B executor's shim returned a bare array, and the exported CODE_MODE_AGENT_PROMPT iterates it as an array:

// VM
const tools = await search_tools("github");   // { meta: {...}, results: [...] }
for (const tool of tools) { … }               // TypeError: tools is not iterable

// E2B
const tools = await search_tools("github");   // [ { name, server, description, input_schema }, … ]
for (const tool of tools) { … }               // works

So a snippet written the way the prompt (and the docs) show runs on E2B and fails on the VM, and meta is unavailable on E2B. The E2B shim also only matched the query against a tool's name and description, while the VM path also matches the server name.

Reproduced on main (8d8034e) with the tests in this PR (all three fail before the change).

Language / Project Scope

  • TypeScript

Changes

  • E2BCodeExecutor.generateShim() now emits a search_tools() that returns the same { meta, results } envelope as BaseCodeExecutor.createSearchToolsFunction() and searchTools() — for every detail level, with total_tools, sorted namespaces and result_count, and server-name matching in the query.
  • The shim keeps searching the full tool records before projecting to the requested detail level (its existing order). fix(client): preserve description matches in names-only tool search #2728 applies the same order to the VM executor; on main today the VM still projects first, so a description-only match at the names level is currently found on E2B but not on the VM — that gap closes when fix(client): preserve description matches in names-only tool search #2728 lands, and this PR deliberately keeps E2B's behavior instead of copying the bug.
  • CODE_MODE_AGENT_PROMPT examples read results (and destructure it) instead of iterating the return value.
  • docs/typescript/api-reference/client/code-mode.mdx states that the in-sandbox helper returns the same { meta, results } envelope on both executors, and that which tools a query matches can still differ until fix(client): preserve description matches in names-only tool search #2728 lands.
  • Four parity tests in packages/client/tests/unit/client/code-mode-search-tools-parity.test.ts: three compare the shim's output with the VM implementation directly, and one asserts the search-then-project order that fix(client): preserve description matches in names-only tool search #2728 gives the VM.
  • Changeset: @mcp-use/client minor — the E2B helper's return shape changes for anyone who used the old array form.

Implementation Details

  • meta.total_tools counts all tools in the catalog (not the filtered list), meta.namespaces is the sorted list of servers that have tools, and meta.result_count is the filtered length — copied from createSearchToolsFunction() so the two implementations stay comparable. The code_mode self-server is already excluded by getToolNamespaces(), which feeds both paths.
  • The detail levels keep their per-entry shape (names → {name, server}, descriptions → {name, server, description}, full → the full record with input_schema); only the envelope is added.
  • No API or type change for searchTools(); the shim now matches the type it already documented.
  • This complements fix(client): expose the sanitized server alias in the VM code executor #2964 (server-name alias parity on the VM executor): both make a code-mode snippet behave the same on either executor.

Coordination with other open PRs

TypeScript Checklist

Packages Modified

  • docs
  • tests
  • cli
  • create-mcp-use-app
  • mcp-use (server)
  • mcp-use (client)
  • inspector

Pre-commit Checklist

  • Ran pnpm lint:fix / eslint on the changed files
  • Ran pnpm format (Prettier)
  • Ran pnpm build and it succeeds (@mcp-use/client)
  • Ran pnpm changeset
  • Added tests
  • Updated documentation

Example Usage (Before)

// E2B executor
const tools = await search_tools("github");
console.log(tools.map(t => t.name));      // works — array
console.log(tools.meta.result_count);     // undefined

// VM executor
const tools = await search_tools("github");
for (const tool of tools) { … }           // TypeError: tools is not iterable

Example Usage (After)

// both executors
const { results, meta } = await search_tools("github");
for (const tool of results) { … }
console.log(meta.result_count);

Testing

  • New: packages/client/tests/unit/client/code-mode-search-tools-parity.test.ts — 4 tests on the evaluated E2B shim: default query, server-name match and all three detail levels compared with VMCodeExecutor.createSearchToolsFunction(), plus the search-then-project order (found at the names level; not compared with today's VM, see fix(client): preserve description matches in names-only tool search #2728). All four fail on 8d8034e and pass with the change.
  • Full client unit suite: 423 passed, 1 skipped.
  • tsc --noEmit, eslint, prettier: clean. pnpm --filter @mcp-use/client build: success.

Backwards Compatibility

The E2B search_tools() helper's return value changes from an array to the { meta, results } object that the VM executor, searchTools() and the API docs already describe. A snippet that iterated the array directly must read .results; snippets written against the prompt examples already do after this change. The changeset is marked minor for that reason.

Related Issues

No existing issue covers this. Related open PRs: #2964 (the same executor-parity class of bug for server namespaces) and #2728 (VM side of the search-then-project order).

@mintlify

mintlify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit f952daa.

Approve preview

@pkg-pr-new

pkg-pr-new Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@mcp-use/agent

npm i https://pkg.pr.new/@mcp-use/agent@2965

@mcp-use/cli

npm i https://pkg.pr.new/@mcp-use/cli@2965

@mcp-use/client

npm i https://pkg.pr.new/@mcp-use/client@2965

create-mcp-use-app

npm i https://pkg.pr.new/create-mcp-use-app@2965

@mcp-use/inspector

npm i https://pkg.pr.new/@mcp-use/inspector@2965

mcp-use

npm i https://pkg.pr.new/mcp-use@2965

@mcp-use/tunnel

npm i https://pkg.pr.new/@mcp-use/tunnel@2965

commit: f952daa

@BlueX888
BlueX888 force-pushed the fix/code-mode-e2b-search-tools-parity branch from 0973bd3 to 3d27904 Compare October 28, 2026 01:28

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="libraries/typescript/.changeset/code-mode-e2b-search-tools-parity.md">

<violation number="1" location="libraries/typescript/.changeset/code-mode-e2b-search-tools-parity.md:2">
P1: `search_tools()` changes from an array to `{ meta, results }`, so existing E2B snippets using `.map`, `for...of`, or array destructuring now fail. This is a breaking `@mcp-use/client` contract; use a major bump or preserve array compatibility instead of publishing it as minor.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@@ -0,0 +1,5 @@
---
"@mcp-use/client": minor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: search_tools() changes from an array to { meta, results }, so existing E2B snippets using .map, for...of, or array destructuring now fail. This is a breaking @mcp-use/client contract; use a major bump or preserve array compatibility instead of publishing it as minor.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At libraries/typescript/.changeset/code-mode-e2b-search-tools-parity.md, line 2:

<comment>`search_tools()` changes from an array to `{ meta, results }`, so existing E2B snippets using `.map`, `for...of`, or array destructuring now fail. This is a breaking `@mcp-use/client` contract; use a major bump or preserve array compatibility instead of publishing it as minor.</comment>

<file context>
@@ -0,0 +1,5 @@
+---
+"@mcp-use/client": minor
+---
+
</file context>
Suggested change
"@mcp-use/client": minor
"@mcp-use/client": major

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

TypeScript Conformance (current head)

Runner: @modelcontextprotocol/[email protected]
Spec versions: 2025-11-25 2026-07-28

Score: 2006/2012 passed (6 expected failures, 0 unexpected failures, 4 expected warnings, 0 unexpected warnings)

Suite Score Expected failures Unexpected failures Expected warnings Unexpected warnings
2025-11-25/client-browser/auth/basic-cimd-2026-11-04T17-16-59-436Z 12/12 0 0 0 0
2025-11-25/client-browser/auth/metadata-default-2026-11-04T17-16-59-436Z 12/12 0 0 0 0
2025-11-25/client-browser/auth/metadata-var1-2026-11-04T17-16-59-436Z 12/12 0 0 0 0
2025-11-25/client-browser/auth/metadata-var2-2026-11-04T17-16-59-436Z 12/12 0 0 0 0
2025-11-25/client-browser/auth/metadata-var3-2026-11-04T17-16-59-436Z 12/12 0 0 0 0
2025-11-25/client-browser/auth/pre-registration-2026-11-04T17-16-59-436Z 12/12 0 0 0 0
2025-11-25/client-browser/auth/scope-from-scopes-supported-2026-11-04T17-16-59-436Z 13/13 0 0 0 0
2025-11-25/client-browser/auth/scope-from-www-authenticate-2026-11-04T17-16-59-436Z 13/13 0 0 0 0
2025-11-25/client-browser/auth/scope-omitted-when-undefined-2026-11-04T17-16-59-436Z 13/13 0 0 0 0
2025-11-25/client-browser/auth/scope-retry-limit-2026-11-04T17-16-59-436Z 22/22 0 0 0 0
2025-11-25/client-browser/auth/scope-step-up-2026-11-04T17-16-59-436Z 21/21 0 0 0 0
2025-11-25/client-browser/auth/token-endpoint-auth-basic-2026-11-04T17-16-59-436Z 17/17 0 0 0 0
2025-11-25/client-browser/auth/token-endpoint-auth-none-2026-11-04T17-16-59-436Z 17/17 0 0 0 0
2025-11-25/client-browser/auth/token-endpoint-auth-post-2026-11-04T17-16-59-436Z 17/17 0 0 0 0
2025-11-25/client-browser/elicitation-sep1034-client-defaults-2026-11-04T17-16-59-436Z 5/5 0 0 0 0
2025-11-25/client-browser/initialize-2026-11-04T17-16-59-435Z 1/1 0 0 0 0
2025-11-25/client-browser/sse-retry-2026-11-04T17-16-59-436Z 3/3 0 0 0 0
2025-11-25/client-browser/tools_call-2026-11-04T17-16-59-436Z 1/1 0 0 0 0
2025-11-25/client-node/auth/basic-cimd-2026-11-04T17-16-42-813Z 12/12 0 0 0 0
2025-11-25/client-node/auth/metadata-default-2026-11-04T17-16-42-813Z 12/12 0 0 0 0
2025-11-25/client-node/auth/metadata-var1-2026-11-04T17-16-42-813Z 12/12 0 0 0 0
2025-11-25/client-node/auth/metadata-var2-2026-11-04T17-16-42-813Z 12/12 0 0 0 0
2025-11-25/client-node/auth/metadata-var3-2026-11-04T17-16-42-813Z 12/12 0 0 0 0
2025-11-25/client-node/auth/pre-registration-2026-11-04T17-16-42-813Z 12/12 0 0 0 0
2025-11-25/client-node/auth/scope-from-scopes-supported-2026-11-04T17-16-42-813Z 13/13 0 0 0 0
2025-11-25/client-node/auth/scope-from-www-authenticate-2026-11-04T17-16-42-813Z 13/13 0 0 0 0
2025-11-25/client-node/auth/scope-omitted-when-undefined-2026-11-04T17-16-42-813Z 13/13 0 0 0 0
2025-11-25/client-node/auth/scope-retry-limit-2026-11-04T17-16-42-813Z 22/22 0 0 0 0
2025-11-25/client-node/auth/scope-step-up-2026-11-04T17-16-42-813Z 21/21 0 0 0 0
2025-11-25/client-node/auth/token-endpoint-auth-basic-2026-11-04T17-16-42-813Z 17/17 0 0 0 0
2025-11-25/client-node/auth/token-endpoint-auth-none-2026-11-04T17-16-42-813Z 17/17 0 0 0 0
2025-11-25/client-node/auth/token-endpoint-auth-post-2026-11-04T17-16-42-813Z 17/17 0 0 0 0
2025-11-25/client-node/elicitation-sep1034-client-defaults-2026-11-04T17-16-42-813Z 5/5 0 0 0 0
2025-11-25/client-node/initialize-2026-11-04T17-16-42-812Z 1/1 0 0 0 0
2025-11-25/client-node/sse-retry-2026-11-04T17-16-42-813Z 3/3 0 0 0 0
2025-11-25/client-node/tools_call-2026-11-04T17-16-42-813Z 1/1 0 0 0 0
2025-11-25/client-react/auth/basic-cimd-2026-11-04T17-17-15-021Z 16/16 0 0 0 0
2025-11-25/client-react/auth/metadata-default-2026-11-04T17-17-15-021Z 15/15 0 0 0 0
2025-11-25/client-react/auth/metadata-var1-2026-11-04T17-17-15-021Z 15/15 0 0 0 0
2025-11-25/client-react/auth/metadata-var2-2026-11-04T17-17-15-021Z 15/15 0 0 0 0
2025-11-25/client-react/auth/metadata-var3-2026-11-04T17-17-15-021Z 12/12 0 0 0 0
2025-11-25/client-react/auth/pre-registration-2026-11-04T17-17-15-021Z 15/15 0 0 0 0
2025-11-25/client-react/auth/scope-from-scopes-supported-2026-11-04T17-17-15-021Z 17/17 0 0 0 0
2025-11-25/client-react/auth/scope-from-www-authenticate-2026-11-04T17-17-15-021Z 14/14 0 0 0 0
2025-11-25/client-react/auth/scope-omitted-when-undefined-2026-11-04T17-17-15-021Z 17/17 0 0 0 0
2025-11-25/client-react/auth/scope-retry-limit-2026-11-04T17-17-15-021Z 23/23 0 0 0 0
2025-11-25/client-react/auth/scope-step-up-2026-11-04T17-17-15-021Z 21/21 0 0 0 0
2025-11-25/client-react/auth/token-endpoint-auth-basic-2026-11-04T17-17-15-021Z 20/20 0 0 0 0
2025-11-25/client-react/auth/token-endpoint-auth-none-2026-11-04T17-17-15-021Z 20/20 0 0 0 0
2025-11-25/client-react/auth/token-endpoint-auth-post-2026-11-04T17-17-15-021Z 20/20 0 0 0 0
2025-11-25/client-react/elicitation-sep1034-client-defaults-2026-11-04T17-17-15-020Z 5/5 0 0 0 0
2025-11-25/client-react/initialize-2026-11-04T17-17-15-020Z 1/1 0 0 0 0
2025-11-25/client-react/sse-retry-2026-11-04T17-17-15-020Z 3/3 0 0 0 0
2025-11-25/client-react/tools_call-2026-11-04T17-17-15-020Z 1/1 0 0 0 0
2025-11-25/server/server-completion-complete-2026-11-04T17-16-41-140Z 1/1 0 0 0 0
2025-11-25/server/server-dns-rebinding-protection-2026-11-04T17-16-41-952Z 2/2 0 0 0 0
2025-11-25/server/server-elicitation-sep1034-defaults-2026-11-04T17-16-41-732Z 0/1 1 0 0 0
2025-11-25/server/server-elicitation-sep1330-enums-2026-11-04T17-16-41-771Z 0/1 1 0 0 0
2025-11-25/server/server-json-schema-2020-12-2026-11-04T17-16-41-716Z 7/7 0 0 0 0
2025-11-25/server/server-logging-set-level-2026-11-04T17-16-41-093Z 1/1 0 0 0 0
2025-11-25/server/server-ping-2026-11-04T17-16-41-117Z 1/1 0 0 0 0
2025-11-25/server/server-prompts-get-embedded-resource-2026-11-04T17-16-41-921Z 1/1 0 0 0 0
2025-11-25/server/server-prompts-get-simple-2026-11-04T17-16-41-886Z 1/1 0 0 0 0
2025-11-25/server/server-prompts-get-with-args-2026-11-04T17-16-41-903Z 1/1 0 0 0 0
2025-11-25/server/server-prompts-get-with-image-2026-11-04T17-16-41-938Z 1/1 0 0 0 0
2025-11-25/server/server-prompts-list-2026-11-04T17-16-41-873Z 1/1 0 0 0 0
2025-11-25/server/server-resources-list-2026-11-04T17-16-41-786Z 1/1 0 0 0 0
2025-11-25/server/server-resources-read-binary-2026-11-04T17-16-41-818Z 1/1 0 0 0 0
2025-11-25/server/server-resources-read-text-2026-11-04T17-16-41-802Z 1/1 0 0 0 0
2025-11-25/server/server-resources-subscribe-2026-11-04T17-16-41-846Z 0/1 1 0 0 0
2025-11-25/server/server-resources-templates-read-2026-11-04T17-16-41-832Z 1/1 0 0 0 0
2025-11-25/server/server-resources-unsubscribe-2026-11-04T17-16-41-859Z 0/1 1 0 0 0
2025-11-25/server/server-server-initialize-2026-11-04T17-16-40-995Z 1/1 0 0 0 0
2025-11-25/server/server-server-sse-multiple-streams-2026-11-04T17-16-41-762Z 0/0 0 0 1 0
2025-11-25/server/server-server-sse-polling-2026-11-04T17-16-41-748Z 0/0 0 0 3 0
2025-11-25/server/server-tools-call-audio-2026-11-04T17-16-41-222Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-elicitation-2026-11-04T17-16-41-697Z 0/1 1 0 0 0
2025-11-25/server/server-tools-call-embedded-resource-2026-11-04T17-16-41-240Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-error-2026-11-04T17-16-41-596Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-image-2026-11-04T17-16-41-206Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-mixed-content-2026-11-04T17-16-41-259Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-sampling-2026-11-04T17-16-41-680Z 0/1 1 0 0 0
2025-11-25/server/server-tools-call-simple-text-2026-11-04T17-16-41-185Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-with-logging-2026-11-04T17-16-41-274Z 1/1 0 0 0 0
2025-11-25/server/server-tools-call-with-progress-2026-11-04T17-16-41-613Z 1/1 0 0 0 0
2025-11-25/server/server-tools-list-2026-11-04T17-16-41-157Z 2/2 0 0 0 0
2026-07-28/client-browser/auth/authorization-server-migration-2026-11-04T17-18-36-996Z 26/26 0 0 0 0
2026-07-28/client-browser/auth/basic-cimd-2026-11-04T17-18-36-996Z 11/11 0 0 0 0
2026-07-28/client-browser/auth/iss-normalized-2026-11-04T17-18-36-996Z 8/8 0 0 0 0
2026-07-28/client-browser/auth/iss-not-advertised-2026-11-04T17-18-36-996Z 13/13 0 0 0 0
2026-07-28/client-browser/auth/iss-supported-2026-11-04T17-18-36-996Z 13/13 0 0 0 0
2026-07-28/client-browser/auth/iss-supported-missing-2026-11-04T17-18-36-996Z 8/8 0 0 0 0
2026-07-28/client-browser/auth/iss-unexpected-2026-11-04T17-18-36-996Z 8/8 0 0 0 0
2026-07-28/client-browser/auth/iss-wrong-issuer-2026-11-04T17-18-36-996Z 8/8 0 0 0 0
2026-07-28/client-browser/auth/metadata-default-2026-11-04T17-18-36-995Z 12/12 0 0 0 0
2026-07-28/client-browser/auth/metadata-issuer-mismatch-2026-11-04T17-18-36-996Z 3/3 0 0 0 0
2026-07-28/client-browser/auth/metadata-var1-2026-11-04T17-18-36-995Z 12/12 0 0 0 0
2026-07-28/client-browser/auth/metadata-var2-2026-11-04T17-18-36-995Z 12/12 0 0 0 0
2026-07-28/client-browser/auth/metadata-var3-2026-11-04T17-18-36-996Z 12/12 0 0 0 0
2026-07-28/client-browser/auth/offline-access-not-supported-2026-11-04T17-18-36-996Z 13/13 0 0 0 0
2026-07-28/client-browser/auth/offline-access-scope-2026-11-04T17-18-36-996Z 11/11 0 0 0 0
2026-07-28/client-browser/auth/pre-registration-2026-11-04T17-18-36-996Z 11/11 0 0 0 0
2026-07-28/client-browser/auth/resource-mismatch-2026-11-04T17-18-36-996Z 3/3 0 0 0 0
2026-07-28/client-browser/auth/scope-from-scopes-supported-2026-11-04T17-18-36-996Z 13/13 0 0 0 0
2026-07-28/client-browser/auth/scope-from-www-authenticate-2026-11-04T17-18-36-996Z 13/13 0 0 0 0
2026-07-28/client-browser/auth/scope-omitted-when-undefined-2026-11-04T17-18-36-996Z 13/13 0 0 0 0
2026-07-28/client-browser/auth/scope-retry-limit-2026-11-04T17-18-36-996Z 23/23 0 0 0 0
2026-07-28/client-browser/auth/scope-step-up-2026-11-04T17-18-36-996Z 24/24 0 0 0 0
2026-07-28/client-browser/auth/token-endpoint-auth-basic-2026-11-04T17-18-36-996Z 17/17 0 0 0 0
2026-07-28/client-browser/auth/token-endpoint-auth-none-2026-11-04T17-18-36-996Z 17/17 0 0 0 0
2026-07-28/client-browser/auth/token-endpoint-auth-post-2026-11-04T17-18-36-996Z 17/17 0 0 0 0
2026-07-28/client-browser/http-custom-headers-2026-11-04T17-18-36-996Z 18/18 0 0 0 0
2026-07-28/client-browser/http-invalid-tool-headers-2026-11-04T17-18-36-996Z 11/11 0 0 0 0
2026-07-28/client-browser/http-standard-headers-2026-11-04T17-18-36-996Z 9/9 0 0 0 0
2026-07-28/client-browser/json-schema-ref-no-deref-2026-11-04T17-18-36-996Z 1/1 0 0 0 0
2026-07-28/client-browser/request-metadata-2026-11-04T17-18-36-995Z 8/8 0 0 0 0
2026-07-28/client-browser/sep-2322-client-request-state-2026-11-04T17-18-36-996Z 5/5 0 0 0 0
2026-07-28/client-browser/tools_call-2026-11-04T17-18-36-995Z 1/1 0 0 0 0
2026-07-28/client-node/auth/authorization-server-migration-2026-11-04T17-18-19-976Z 26/26 0 0 0 0
2026-07-28/client-node/auth/basic-cimd-2026-11-04T17-18-19-976Z 11/11 0 0 0 0
2026-07-28/client-node/auth/iss-normalized-2026-11-04T17-18-19-976Z 8/8 0 0 0 0
2026-07-28/client-node/auth/iss-not-advertised-2026-11-04T17-18-19-976Z 13/13 0 0 0 0
2026-07-28/client-node/auth/iss-supported-2026-11-04T17-18-19-976Z 13/13 0 0 0 0
2026-07-28/client-node/auth/iss-supported-missing-2026-11-04T17-18-19-976Z 8/8 0 0 0 0
2026-07-28/client-node/auth/iss-unexpected-2026-11-04T17-18-19-976Z 8/8 0 0 0 0
2026-07-28/client-node/auth/iss-wrong-issuer-2026-11-04T17-18-19-976Z 8/8 0 0 0 0
2026-07-28/client-node/auth/metadata-default-2026-11-04T17-18-19-976Z 12/12 0 0 0 0
2026-07-28/client-node/auth/metadata-issuer-mismatch-2026-11-04T17-18-19-976Z 3/3 0 0 0 0
2026-07-28/client-node/auth/metadata-var1-2026-11-04T17-18-19-976Z 12/12 0 0 0 0
2026-07-28/client-node/auth/metadata-var2-2026-11-04T17-18-19-976Z 12/12 0 0 0 0
2026-07-28/client-node/auth/metadata-var3-2026-11-04T17-18-19-976Z 12/12 0 0 0 0
2026-07-28/client-node/auth/offline-access-not-supported-2026-11-04T17-18-19-976Z 13/13 0 0 0 0
2026-07-28/client-node/auth/offline-access-scope-2026-11-04T17-18-19-976Z 11/11 0 0 0 0
2026-07-28/client-node/auth/pre-registration-2026-11-04T17-18-19-976Z 11/11 0 0 0 0
2026-07-28/client-node/auth/resource-mismatch-2026-11-04T17-18-19-976Z 3/3 0 0 0 0
2026-07-28/client-node/auth/scope-from-scopes-supported-2026-11-04T17-18-19-976Z 13/13 0 0 0 0
2026-07-28/client-node/auth/scope-from-www-authenticate-2026-11-04T17-18-19-976Z 13/13 0 0 0 0
2026-07-28/client-node/auth/scope-omitted-when-undefined-2026-11-04T17-18-19-976Z 13/13 0 0 0 0
2026-07-28/client-node/auth/scope-retry-limit-2026-11-04T17-18-19-976Z 23/23 0 0 0 0
2026-07-28/client-node/auth/scope-step-up-2026-11-04T17-18-19-976Z 24/24 0 0 0 0
2026-07-28/client-node/auth/token-endpoint-auth-basic-2026-11-04T17-18-19-976Z 17/17 0 0 0 0
2026-07-28/client-node/auth/token-endpoint-auth-none-2026-11-04T17-18-19-976Z 17/17 0 0 0 0
2026-07-28/client-node/auth/token-endpoint-auth-post-2026-11-04T17-18-19-976Z 17/17 0 0 0 0
2026-07-28/client-node/http-custom-headers-2026-11-04T17-18-19-976Z 18/18 0 0 0 0
2026-07-28/client-node/http-invalid-tool-headers-2026-11-04T17-18-19-976Z 11/11 0 0 0 0
2026-07-28/client-node/http-standard-headers-2026-11-04T17-18-19-976Z 9/9 0 0 0 0
2026-07-28/client-node/json-schema-ref-no-deref-2026-11-04T17-18-19-976Z 1/1 0 0 0 0
2026-07-28/client-node/request-metadata-2026-11-04T17-18-19-976Z 8/8 0 0 0 0
2026-07-28/client-node/sep-2322-client-request-state-2026-11-04T17-18-19-976Z 5/5 0 0 0 0
2026-07-28/client-node/tools_call-2026-11-04T17-18-19-975Z 1/1 0 0 0 0
2026-07-28/client-react/auth/authorization-server-migration-2026-11-04T17-18-54-288Z 27/27 0 0 0 0
2026-07-28/client-react/auth/basic-cimd-2026-11-04T17-18-54-288Z 15/15 0 0 0 0
2026-07-28/client-react/auth/iss-normalized-2026-11-04T17-18-54-289Z 11/11 0 0 0 0
2026-07-28/client-react/auth/iss-not-advertised-2026-11-04T17-18-54-289Z 16/16 0 0 0 0
2026-07-28/client-react/auth/iss-supported-2026-11-04T17-18-54-289Z 16/16 0 0 0 0
2026-07-28/client-react/auth/iss-supported-missing-2026-11-04T17-18-54-289Z 11/11 0 0 0 0
2026-07-28/client-react/auth/iss-unexpected-2026-11-04T17-18-54-289Z 11/11 0 0 0 0
2026-07-28/client-react/auth/iss-wrong-issuer-2026-11-04T17-18-54-289Z 11/11 0 0 0 0
2026-07-28/client-react/auth/metadata-default-2026-11-04T17-18-54-288Z 15/15 0 0 0 0
2026-07-28/client-react/auth/metadata-issuer-mismatch-2026-11-04T17-18-54-289Z 3/3 0 0 0 0
2026-07-28/client-react/auth/metadata-var1-2026-11-04T17-18-54-288Z 15/15 0 0 0 0
2026-07-28/client-react/auth/metadata-var2-2026-11-04T17-18-54-288Z 15/15 0 0 0 0
2026-07-28/client-react/auth/metadata-var3-2026-11-04T17-18-54-288Z 12/12 0 0 0 0
2026-07-28/client-react/auth/offline-access-not-supported-2026-11-04T17-18-54-288Z 17/17 0 0 0 0
2026-07-28/client-react/auth/offline-access-scope-2026-11-04T17-18-54-288Z 15/15 0 0 0 0
2026-07-28/client-react/auth/pre-registration-2026-11-04T17-18-54-288Z 14/14 0 0 0 0
2026-07-28/client-react/auth/resource-mismatch-2026-11-04T17-18-54-288Z 3/3 0 0 0 0
2026-07-28/client-react/auth/scope-from-scopes-supported-2026-11-04T17-18-54-288Z 17/17 0 0 0 0
2026-07-28/client-react/auth/scope-from-www-authenticate-2026-11-04T17-18-54-288Z 14/14 0 0 0 0
2026-07-28/client-react/auth/scope-omitted-when-undefined-2026-11-04T17-18-54-288Z 17/17 0 0 0 0
2026-07-28/client-react/auth/scope-retry-limit-2026-11-04T17-18-54-288Z 23/23 0 0 0 0
2026-07-28/client-react/auth/scope-step-up-2026-11-04T17-18-54-288Z 24/24 0 0 0 0
2026-07-28/client-react/auth/token-endpoint-auth-basic-2026-11-04T17-18-54-288Z 20/20 0 0 0 0
2026-07-28/client-react/auth/token-endpoint-auth-none-2026-11-04T17-18-54-288Z 20/20 0 0 0 0
2026-07-28/client-react/auth/token-endpoint-auth-post-2026-11-04T17-18-54-288Z 20/20 0 0 0 0
2026-07-28/client-react/http-custom-headers-2026-11-04T17-18-54-289Z 18/18 0 0 0 0
2026-07-28/client-react/http-invalid-tool-headers-2026-11-04T17-18-54-289Z 11/11 0 0 0 0
2026-07-28/client-react/http-standard-headers-2026-11-04T17-18-54-289Z 6/6 0 0 0 0
2026-07-28/client-react/json-schema-ref-no-deref-2026-11-04T17-18-54-289Z 1/1 0 0 0 0
2026-07-28/client-react/request-metadata-2026-11-04T17-18-54-288Z 8/8 0 0 0 0
2026-07-28/client-react/sep-2322-client-request-state-2026-11-04T17-18-54-289Z 5/5 0 0 0 0
2026-07-28/client-react/tools_call-2026-11-04T17-18-54-288Z 1/1 0 0 0 0
2026-07-28/server/server-caching-2026-11-04T17-18-18-994Z 7/7 0 0 0 0
2026-07-28/server/server-completion-complete-2026-11-04T17-18-18-800Z 1/1 0 0 0 0
2026-07-28/server/server-dns-rebinding-protection-2026-11-04T17-18-18-983Z 2/2 0 0 0 0
2026-07-28/server/server-http-custom-header-server-validation-2026-11-04T17-18-19-050Z 9/9 0 0 0 0
2026-07-28/server/server-http-header-validation-2026-11-04T17-18-19-018Z 13/13 0 0 0 0
2026-07-28/server/server-input-required-result-basic-elicitation-2026-11-04T17-18-19-071Z 2/2 0 0 0 0
2026-07-28/server/server-input-required-result-basic-list-roots-2026-11-04T17-18-19-091Z 2/2 0 0 0 0
2026-07-28/server/server-input-required-result-basic-sampling-2026-11-04T17-18-19-081Z 2/2 0 0 0 0
2026-07-28/server/server-input-required-result-capability-check-2026-11-04T17-18-19-186Z 1/1 0 0 0 0
2026-07-28/server/server-input-required-result-ignore-extra-params-2026-11-04T17-18-19-192Z 1/1 0 0 0 0
2026-07-28/server/server-input-required-result-missing-input-response-2026-11-04T17-18-19-132Z 1/1 0 0 0 0
2026-07-28/server/server-input-required-result-multi-round-2026-11-04T17-18-19-119Z 3/3 0 0 0 0
2026-07-28/server/server-input-required-result-multiple-input-requests-2026-11-04T17-18-19-109Z 2/2 0 0 0 0
2026-07-28/server/server-input-required-result-non-tool-request-2026-11-04T17-18-19-139Z 2/2 0 0 0 0
2026-07-28/server/server-input-required-result-request-state-2026-11-04T17-18-19-099Z 2/2 0 0 0 0
2026-07-28/server/server-input-required-result-result-type-2026-11-04T17-18-19-150Z 1/1 0 0 0 0
2026-07-28/server/server-input-required-result-tampered-state-2026-11-04T17-18-19-174Z 1/1 0 0 0 0
2026-07-28/server/server-input-required-result-unsupported-methods-2026-11-04T17-18-19-156Z 1/1 0 0 0 0
2026-07-28/server/server-input-required-result-validate-input-2026-11-04T17-18-19-197Z 2/2 0 0 0 0
2026-07-28/server/server-json-schema-2020-12-2026-11-04T17-18-18-915Z 7/7 0 0 0 0
2026-07-28/server/server-prompts-get-embedded-resource-2026-11-04T17-18-18-972Z 1/1 0 0 0 0
2026-07-28/server/server-prompts-get-simple-2026-11-04T17-18-18-963Z 1/1 0 0 0 0
2026-07-28/server/server-prompts-get-with-args-2026-11-04T17-18-18-968Z 1/1 0 0 0 0
2026-07-28/server/server-prompts-get-with-image-2026-11-04T17-18-18-978Z 1/1 0 0 0 0
2026-07-28/server/server-prompts-list-2026-11-04T17-18-18-959Z 1/1 0 0 0 0
2026-07-28/server/server-resources-list-2026-11-04T17-18-18-937Z 1/1 0 0 0 0
2026-07-28/server/server-resources-read-binary-2026-11-04T17-18-18-946Z 1/1 0 0 0 0
2026-07-28/server/server-resources-read-text-2026-11-04T17-18-18-941Z 1/1 0 0 0 0
2026-07-28/server/server-resources-templates-read-2026-11-04T17-18-18-950Z 1/1 0 0 0 0
2026-07-28/server/server-sep-2164-resource-not-found-2026-11-04T17-18-18-954Z 3/3 0 0 0 0
2026-07-28/server/server-server-sse-multiple-streams-2026-11-04T17-18-18-923Z 1/1 0 0 0 0
2026-07-28/server/server-server-stateless-2026-11-04T17-18-17-157Z 30/30 0 0 0 0
2026-07-28/server/server-tools-call-audio-2026-11-04T17-18-18-829Z 1/1 0 0 0 0
2026-07-28/server/server-tools-call-embedded-resource-2026-11-04T17-18-18-834Z 1/1 0 0 0 0
2026-07-28/server/server-tools-call-error-2026-11-04T17-18-18-850Z 1/1 0 0 0 0
2026-07-28/server/server-tools-call-image-2026-11-04T17-18-18-824Z 1/1 0 0 0 0
2026-07-28/server/server-tools-call-mixed-content-2026-11-04T17-18-18-844Z 1/1 0 0 0 0
2026-07-28/server/server-tools-call-simple-text-2026-11-04T17-18-18-820Z 1/1 0 0 0 0
2026-07-28/server/server-tools-call-with-progress-2026-11-04T17-18-18-856Z 1/1 0 0 0 0
2026-07-28/server/server-tools-list-2026-11-04T17-18-18-810Z 2/2 0 0 0 0

@BlueX888

Copy link
Copy Markdown
Contributor Author

Keeping minor, with the reasoning explicit:

  • search_tools() is not exported from @mcp-use/client; it is generated inside the sandbox by the executor, so the package's import surface does not change. The change affects snippets that call it at runtime, which the changeset and the PR body both call out.
  • The documented contract for this helper was already the { meta, results } envelope (ToolSearchResponse); the bare array was the undocumented deviation, and the VM executor, searchTools() and the prompt examples disagree with it.
  • minor is the most cautious non-major option; I did not use major because nothing importable breaks. If you treat the in-sandbox helper as part of the public contract, say so and I will switch the changeset to major — that is a maintainer call I did not want to make unilaterally.

@BlueX888
BlueX888 force-pushed the fix/code-mode-e2b-search-tools-parity branch from 3d27904 to d34c48b Compare November 4, 2026 16:21

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

`BaseCodeExecutor.createSearchToolsFunction()` (used by the VM executor) and
the `searchTools()` API both return a `ToolSearchResponse`
(`{ meta: { total_tools, namespaces, result_count }, results }`), and the
exported code-mode agent prompt reads a `results` array. The E2B shim returned
a bare array for `full` and plain arrays for `names`/`descriptions`, without
`meta`, and did not match the query against the server name, so the same
snippet behaved differently depending on the executor and the prompt's
`for (const tool of tools)` loop failed on the VM.

Generate the same document in the E2B shim: `{ meta, results }` for every
detail level, server-name matching in the query, and sorted `namespaces`.
The shim keeps searching the full records before projecting to the requested
detail level, which is the order mcp-use#2728 applies to the VM executor (the VM still
projects first on main). Update the prompt examples and the API page to read
`.results`.

Co-Authored-By: Claude Code <[email protected]>
@BlueX888
BlueX888 force-pushed the fix/code-mode-e2b-search-tools-parity branch from d34c48b to f952daa Compare November 4, 2026 17:15
@BlueX888

BlueX888 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the P2 in f952daa2: the { meta, results } guidance now lives in the current docs page, docs/typescript/client/code-mode.mdx, with a short search_tools() example. I dropped the legacy docs/v1/... edit per docs/CLAUDE.md (v1 pages are legacy and should not be updated). The E2B/VM parity test and the client suite remain green after the rebase.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant