Caravela.MCP.Tool.ValidateDsl (Caravela v0.13.2)

Copy Markdown View Source

MCP tool: compile a candidate Caravela domain DSL and report any errors as structured data.

The tool spawns a fresh VM process with a short-lived code path so the candidate module doesn't pollute the caller's runtime. Success returns the compiled module's IR (so the caller can verify the shape); failure returns the DSLError / GenError / CompileError payload Caravela raises.

Security note

The candidate source is Code.eval_string/1-compiled. That's arbitrary Elixir execution. The server intentionally scopes this tool to localhost stdio transport in 0.10 — when HTTP transport lands, this tool MUST be gated behind auth + sandboxed further (see the future-work section in caravela_plan/phoenix/llm_friendliness.md).