Add translate_prompt_to_dsl and is_dsl_prompt MCP tools#12
Merged
Conversation
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.
2 tasks
f814568 to
7f63296
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vtk-validate's DSL translation layer:translate_prompt_to_dsl(query, model?, base_url?, api_key?)— converts natural language to the VTK pipeline DSLis_dsl_prompt(text)— detects whether input is already in DSL formattranslate_model,translate_base_url,translate_api_keytoSettings(env prefixVTK_MCP_TRANSLATE_*) for server-wide Ollama/custom endpoint configContext
The VTK pipeline DSL (structured
create / <filter> / define / add / renderformat 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 passpytest tests/ -m unit— all 49 unit tests passmistral:latestvia Ollama