1. High-Level Summary (TL;DR)
- Impact: Medium - Enhances the third-party developer tools integration by supporting multiple tool groups per page instead of limiting it to a single group.
- Key Changes:
- ✨ Updated
list_3p_toolsto parse and format an array oftoolGroupswhile maintaining fallback support for the legacy singletoolGroup. - ✨ Refactored
execute_3p_toolto locate and execute a specific tool by iterating through available tool groups if the globalexecuteToolmethod is missing. - 🐛 Improved terminal output formatting to clearly distinguish between multiple tool groups and their respective tools.
- ✨ Updated
2. Detailed Change Analysis
Component: Third-Party Commands
What Changed:
- Tool Listing Update: The injected JavaScript payload inside
list_3p_tools()was updated to preferentially look fordtmcp.toolGroups(an array). If not found, it falls back to the legacydtmcp.toolGroup. The Rust-side JSON parser was adapted to iterate over the newgroupskey and properly indent the available tools under each group header (Source:src/commands/third_party.rs). - Tool Execution Logic:
execute_3p_tool()now checks if a globaldtmcp.executeToolexists. If it doesn't, it loops through the registeredtoolGroups, finds the requested tool by name, and directly invokes its owntool.execute(params)method (Source:src/commands/third_party.rs).
Data Structure Changes
| Object / Field | Old Structure | New Structure | Description |
|---|---|---|---|
| JS Listing Payload | { name, description, tools: [] } |
{ groups: [{ name, description, tools: [] }] } |
Normalizes the returned payload to always provide an array of groups to Rust. |
| Execution Call | dtmcp.executeTool(name, params) |
tool.execute(params) (fallback) |
Allows individual tools inside a group to define their own execute method. |
3. Impact & Risk Assessment
⚠️ Breaking Changes: None. The changes are fully backward-compatible. Pages utilizing the olderwindow.__dtmcp.toolGroupandwindow.__dtmcp.executeToolstructures will continue to function seamlessly through fallback logic.