Primitive Type
Tool (Interactive function)
Primitive Name
codeql_query_compile
Update Type
Feature Enhancement
Current Behavior
The codeql_query_compile MCP tool does not currently have specific support for using the --dump-dil argument when invoking the backend codeql query compile CLI command.
Desired Behavior
The codeql_query_compile MCP tool will always --dump-dil unless the calling LLM explicitly passes --no-dump-dil argument, where always "dumping" the compiled CodeQL query's DIL is what the GitHub.vscode-codeql already supports for any given CodeQL query run. So will the ql-mcp server.
Example Inputs
No response
Expected Outputs
Consistent use of the --dump-dil option when compiling CodeQL queries will consistently produce a *.dil log file for the CodeQL query's Datalog Intermediate Language (DIL) representation of the query evaluation order.
Test Scenarios
This feature must be validated via:
Documentation or Reference Materials
From codeql query compile -h -vv CLI output:
--[no-]dump-dil [Advanced] Print the optimized DIL intermediate
representation to standard output while
compiling.
When JSON output is selected, the DIL will be
represented as an array of single-line strings,
with some wrapping to identify which query is
being compiled.
Use Case Improvement
Always dumping the DIL for a compiled CodeQL query will ensure that the ql-mcp server always provides agentic LLMs with the option of reviewing the pre-query-run execution order (i.e. the DIL) versus the actual query evaluation order, timing, and tuple counts (i.e. result counts per query evaluation stage). Thus, calling LLMs will be able to review the expected query evaluation behavior before running a given query (e.g. with codeql_query_run, codeql_test_run, or codeql_database_analyze MCP tools).
Future work will ensure that the ql-mcp server has tools for parsing DIL to a common data structure that is compatible with the existing profile_codeql_query_from_logs MCP tool, where the query evaluation log data should parse to a superset of the DIL log.
Bug Reproduction Steps (If applicable)
No response
Error Messages or Logs (If applicable)
No response
References
https://docs.github.com/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-vs-code/running-codeql-queries#understanding-your-query-results
Priority Level
Medium (Notable improvement)
Breaking Changes Acceptable
Minor - Small API changes acceptable with deprecation
Update Checklist (Auto-populated for LLM guidance)
Code of Conduct
Primitive Type
Tool (Interactive function)
Primitive Name
codeql_query_compile
Update Type
Feature Enhancement
Current Behavior
The
codeql_query_compileMCP tool does not currently have specific support for using the--dump-dilargument when invoking the backendcodeql query compileCLI command.Desired Behavior
The
codeql_query_compileMCP tool will always--dump-dilunless the calling LLM explicitly passes--no-dump-dilargument, where always "dumping" the compiled CodeQL query's DIL is what theGitHub.vscode-codeqlalready supports for any given CodeQL query run. So will theql-mcpserver.Example Inputs
No response
Expected Outputs
Consistent use of the
--dump-diloption when compiling CodeQL queries will consistently produce a*.dillog file for the CodeQL query's Datalog Intermediate Language (DIL) representation of the query evaluation order.Test Scenarios
This feature must be validated via:
codeql_query_compiletool;Documentation or Reference Materials
From
codeql query compile -h -vvCLI output:Use Case Improvement
Always dumping the DIL for a compiled CodeQL query will ensure that the
ql-mcpserver always provides agentic LLMs with the option of reviewing the pre-query-run execution order (i.e. the DIL) versus the actual query evaluation order, timing, and tuple counts (i.e. result counts per query evaluation stage). Thus, calling LLMs will be able to review the expected query evaluation behavior before running a given query (e.g. withcodeql_query_run,codeql_test_run, orcodeql_database_analyzeMCP tools).Future work will ensure that the
ql-mcpserver has tools for parsing DIL to a common data structure that is compatible with the existingprofile_codeql_query_from_logsMCP tool, where the query evaluation log data should parse to a superset of the DIL log.Bug Reproduction Steps (If applicable)
No response
Error Messages or Logs (If applicable)
No response
References
https://docs.github.com/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-vs-code/running-codeql-queries#understanding-your-query-results
Priority Level
Medium (Notable improvement)
Breaking Changes Acceptable
Minor - Small API changes acceptable with deprecation
Update Checklist (Auto-populated for LLM guidance)
Code of Conduct