You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Calling preview_close fails with Tool preview_close not found when dispatched as lazy MCP tool #37401
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Start an agent turn in a provider using the t3-code MCP tools (or when instructed to close preview tabs at turn completion).
The agent attempts to clean up its open preview tab using call_mcp_tool(ServerName: "t3-code", ToolName: "preview_close", Arguments: {}) or native preview_close().
Observe the tool call response returned by the MCP dispatcher.
Expected behavior
The tool call should execute successfully and close the tab (or return a graceful no-op { success: true, message: "No active preview tab to close" } if no tab is currently open or if tabs were already closed).
Actual behavior
The MCP dispatch fails with an error:
Encountered error in step execution: calling "tools/call": Tool 'preview_close' not found
This happens because preview_close is conditionally or lazily registered in the server's MCP tool set depending on runtime browser host state, causing it to be missing from the static tool manifest exposed to agents at turn initialization. Consequently, automated agent instructions (such as "close tab before replying") fail with an error step.
Impact
Minor bug or occasional failure
Version or commit
T3 Code 0.1.9 / core 0.169.0
Environment
Windows 11 x64, Desktop & Server, Provider: Antigravity ACP / MCP Server t3-code
Workaround & Suggested Fix
In apps/server/src/mcp (or the MCP browser tools definition):
Statically register preview_close alongside preview_status, preview_open, and preview_navigate. If called when no preview session or tab exists, resolve gracefully:
{content: [{type: "text",text: "No active preview tab to close."}],isError: false}
This allows agents to safely enforce cleanup policies without throwing unhandled MCP tool errors.
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.
Activity
juliusmarminge commentedon Nov 15, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.