elements.md's 42-tool catalog is authored for external MCP clients that talk to pen-mcp's full handler set via stdio/HTTP. The embedded orchestrator (this runtime) can only execute tools with BOTH a client-side shim (element-tool-shims) AND a matching Nitro SERVER_BUILDERS entry — currently 10 of the 42. Prior code advertised the full catalog to the AI and promised HTTP fallback coverage without restriction, so 32/42 tool names would silently route through to a 404 → surfaced-error path. Fix: - Export SUPPORTED_EMBEDDED_ELEMENT_TOOLS from the shim module as the canonical covered list. Shim + Nitro registries stay in sync by convention; extending coverage requires updating both. - Dispatcher short-circuits on tool names not in the list — no wasted HTTP roundtrip, diagnostic carries the covered-list so the caller can route to batch_design. - ELEMENT_TOOL_OUTPUT_FORMAT in orchestrator-sub-agent names the available subset inline so the AI knows which add_*_v0 it can emit and when to fall back to batch_design. - JSDoc in dispatcher, shim module, and exec-tool endpoint updated to reflect actual behavior (insertStreamingNode path, embedded- vs-external coverage asymmetry) instead of the stale "HTTP fallback covers everything" story. - New test locks the short-circuit: calling an uncovered tool name (e.g. add_divider_v0) must not attempt fetch. Real follow-up work is still to extract the remaining ~32 pen-mcp tool tree-build functions into pen-core, shim them, and extend SERVER_BUILDERS. Until then, the routes advertised to the AI actually match what the runtime can execute. |
||
|---|---|---|
| .. | ||
| ai | ||
| mcp | ||
| local-asset.get.ts | ||