Skip to content

MCP: add tools.* namespace for plugin discovery + activation#5996

Merged
Grantim merged 1 commit into
masterfrom
mcp-tools-namespace
Apr 27, 2026
Merged

MCP: add tools.* namespace for plugin discovery + activation#5996
Grantim merged 1 commit into
masterfrom
mcp-tools-namespace

Conversation

@Grantim
Copy link
Copy Markdown
Contributor

@Grantim Grantim commented Apr 27, 2026

Follow-up to #5972 / #5980 / #5982 (MCP scene/viewer/ui namespaces). Adds a tools.* namespace so LLMs can enumerate and operate ribbon plugins by id without walking the ribbon UI tree.

Tools

  • tools.listAll — sorted array of every registered ribbon item id (~300). Tab-independent, unlike ui.listAllEntries which only sees the active ribbon tab.
  • tools.listActive — ids of currently-open state plugins (typically 0–2).
  • tools.getInfo({ids}) — batch metadata lookup. Per-id row: caption, tab, type (button / stateBlocking / stateNonBlocking), active, status (available / disabled: <reason>), tooltip, helpLink. Ids absent from the schema land in a parallel missing array instead of erroring the whole call.
  • tools.action({id}) — clicks / toggles by id. State plugins toggle; one-shot buttons run their action. Mirrors RibbonMenu::getRequirements_'s skip-availability-check-when-active rule.

No new public API — built directly on RibbonSchemaHolder::schema(), RibbonMenuItem::action() / isActive() / isAvailable() / getDynamicTooltip(), and RibbonSchemaHolder::findItemTab.

Verification

Live via SSE against a local debug build:

  • tools.listAll → 309 sorted ids; spot-checks for Save Scene, Decimate Mesh, About, Mesh-based Boolean, Camera, Crash Me.
  • tools.getInfo(["Mesh-based Boolean", "Save Scene", "Show_Hide Global Basis", "Distance Map", "About", "Camera", "Crash Me"]) → all three type variants observed; statuses match selection requirements (disabled: Select exactly two Meshes, etc.); tooltips and helpLinks populated where the schema provides them.
  • tools.action({id:"About"}){active: true}; tools.listActive["About"]; second call → {active: false}; tools.listActive[].
  • tools.action({id:"Binary Operations"}) with no objects selected → tools.action Binary Operations: Select exactly two Voxel Volumes.
  • tools.action({id:"NotAReal Plugin xyz"})tool 'NotAReal Plugin xyz' not found.

🤖 Generated with Claude Code

Four read-only or activate-style tools backed by RibbonSchemaHolder. Lets an
LLM enumerate and operate plugins by id without walking the ribbon UI tree:

- tools.listAll       — sorted ids of every registered ribbon item
- tools.listActive    — ids of currently-open state plugins
- tools.getInfo(ids)  — batch metadata: caption, tab, type, active, status,
                        tooltip, helpLink (missing ids land in `missing`)
- tools.action(id)    — clicks/toggles by id; mirrors RibbonMenu's
                        skip-availability-check-when-active rule

No new public API on RibbonMenu/RibbonSchemaHolder — uses existing primitives.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
<ClCompile Include="MRViewerMcp.cpp">
<Filter>MCP</Filter>
</ClCompile>
<ClCompile Include="MRToolsMcp.cpp">
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.

May be better name it "MRMcpTools.cpp" as below item?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

naming as others mcp namespaces ("scene" "ui" "tools" "viewer")

@Grantim Grantim merged commit 7def094 into master Apr 27, 2026
35 checks passed
@Grantim Grantim deleted the mcp-tools-namespace branch April 27, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants