Skip to content

Add translate_prompt_to_dsl and is_dsl_prompt MCP tools#12

Merged
vicentebolea merged 2 commits into
masterfrom
feat/dsl-translation
Jun 13, 2026
Merged

Add translate_prompt_to_dsl and is_dsl_prompt MCP tools#12
vicentebolea merged 2 commits into
masterfrom
feat/dsl-translation

Conversation

@vicentebolea

Copy link
Copy Markdown
Member

Summary

  • Adds two new MCP tools wrapping vtk-validate's DSL translation layer:
    • translate_prompt_to_dsl(query, model?, base_url?, api_key?) — converts natural language to the VTK pipeline DSL
    • is_dsl_prompt(text) — detects whether input is already in DSL format
  • Adds translate_model, translate_base_url, translate_api_key to Settings (env prefix VTK_MCP_TRANSLATE_*) for server-wide Ollama/custom endpoint config
  • All parameters are also overridable per tool call, taking precedence over env vars
  • 8 new unit tests

Context

The VTK pipeline DSL (structured create / <filter> / define / add / render format with snake_case parameter names) produces significantly better code generation than natural language. This pair of tools enables vtk-prompt (and other MCP clients) to translate free-form input into that format before code generation.

Depends on vtk-validate[translate] being installed.

Test plan

  • pytest tests/test_dsl_tools.py — 8 tests pass
  • pytest tests/ -m unit — all 49 unit tests pass
  • Manually tested end-to-end with mistral:latest via Ollama

Exposes vtk-validate's DSL translation layer as two new MCP tools:
- translate_prompt_to_dsl(query, model, base_url, api_key): converts
  natural language to the VTK pipeline DSL via litellm; model and
  endpoint are overridable per-call or via VTK_MCP_TRANSLATE_* env vars
- is_dsl_prompt(text): returns True if the input is already in DSL format

Adds translate_model, translate_base_url, translate_api_key to Settings
to configure Ollama and other OpenAI-compatible endpoints server-wide.
Includes 8 unit tests.
@vicentebolea vicentebolea force-pushed the feat/dsl-translation branch from f814568 to 7f63296 Compare June 13, 2026 00:42
@vicentebolea vicentebolea merged commit f511e8b into master Jun 13, 2026
11 of 14 checks passed
@vicentebolea vicentebolea deleted the feat/dsl-translation branch June 13, 2026 00:45
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.

1 participant