Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# `read_database_source` - list_source_files

## Purpose

Tests the `read_database_source` tool in listing mode by omitting `filePath` to list all source files in a CodeQL database source archive.

## Inputs

- **database**: Path to the JavaScript example test database

## Expected Behavior

The tool should return a listing of all source files in the database's `src/` directory, including `totalEntries`, `returnedEntries`, and `truncated` metadata.

## Static Files Referenced

- `server/ql/javascript/examples/test/ExampleQuery1/ExampleQuery1.testproj`
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"sessions": [
{
"id": "integration_test_session",
"calls": [
{
"tool": "read_database_source",
"timestamp": "2025-09-25T16:06:00.000Z",
"status": "success"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sessions": [],
"parameters": {
"databasePath": "server/ql/javascript/examples/test/ExampleQuery1/ExampleQuery1.testproj"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# `read_database_source` - read_source_file

## Purpose

Tests the `read_database_source` tool in file-read mode by requesting a specific source file from a CodeQL database source archive.

## Inputs

- **database**: Path to the JavaScript example test database
- **filePath**: Path to a source file within the database archive

## Expected Behavior

The tool should return the contents of the requested source file along with metadata including `entryPath`, `sourceType`, `totalLines`, `startLine`, and `endLine`.

## Static Files Referenced

- `server/ql/javascript/examples/test/ExampleQuery1/ExampleQuery1.testproj`
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"sessions": [
{
"id": "integration_test_session",
"calls": [
{
"tool": "read_database_source",
"timestamp": "2025-09-25T16:06:00.000Z",
"status": "success"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sessions": [],
"parameters": {
"databasePath": "server/ql/javascript/examples/test/ExampleQuery1/ExampleQuery1.testproj",
"filePath": "ExampleQuery1.js"
}
}
28 changes: 15 additions & 13 deletions docs/ql-mcp/prompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@

## Overview

The server provides **10 prompts** that guide AI assistants through common CodeQL development workflows. Each prompt is backed by a `*.prompt.md` file containing structured instructions.
The server provides **11 prompts** that guide AI assistants through common CodeQL development workflows. Each prompt is backed by a `*.prompt.md` file containing structured instructions.

## Prompt Reference

| Prompt | Description |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| `document_codeql_query` | Create or update documentation for a CodeQL query |
| `explain_codeql_query` | Generate a detailed explanation of a CodeQL query for workshop learning content |
| `ql_lsp_iterative_development` | Iterative CodeQL query development using LSP tools for completion, navigation, and validation |
| `ql_tdd_advanced` | Advanced test-driven CodeQL development with AST visualization, control flow, and call graph analysis |
| `ql_tdd_basic` | Test-driven CodeQL query development checklist — write tests first, implement query, iterate until tests pass |
| `sarif_rank_false_positives` | Analyze SARIF results to identify likely false positives in CodeQL query results |
| `sarif_rank_true_positives` | Analyze SARIF results to identify likely true positives in CodeQL query results |
| `test_driven_development` | Test-driven development workflow for CodeQL queries using MCP tools |
| `tools_query_workflow` | Guide for using built-in tools queries (PrintAST, PrintCFG, CallGraphFrom, CallGraphTo) to understand code structure |
| `workshop_creation_workflow` | Guide for creating CodeQL query development workshops from production-grade queries |
| Prompt | Description |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `document_codeql_query` | Create or update documentation for a CodeQL query |
| `explain_codeql_query` | Generate a detailed explanation of a CodeQL query for workshop learning content |
| `ql_lsp_iterative_development` | Iterative CodeQL query development using LSP tools for completion, navigation, and validation |
| `ql_tdd_advanced` | Advanced test-driven CodeQL development with AST visualization, control flow, and call graph analysis |
| `ql_tdd_basic` | Test-driven CodeQL query development checklist — write tests first, implement query, iterate until tests pass |
| `run_query_and_summarize_false_positives` | Run a CodeQL query and summarize its false positives |
| `sarif_rank_false_positives` | Analyze SARIF results to identify likely false positives in CodeQL query results |
| `sarif_rank_true_positives` | Analyze SARIF results to identify likely true positives in CodeQL query results |
| `test_driven_development` | Test-driven development workflow for CodeQL queries using MCP tools |
| `tools_query_workflow` | Guide for using built-in tools queries (PrintAST, PrintCFG, CallGraphFrom, CallGraphTo) to understand code structure |
| `workshop_creation_workflow` | Guide for creating CodeQL query development workshops from production-grade queries |

## Prompt Categories

Expand All @@ -41,6 +42,7 @@ The server provides **10 prompts** that guide AI assistants through common CodeQ
### Documentation and Quality

- **`document_codeql_query`** — Generates standardized markdown documentation as a sibling file to a query.
- **`run_query_and_summarize_false_positives`** — Runs a CodeQL query on a database and groups results into false-positive categories by root cause.
- **`sarif_rank_false_positives`** / **`sarif_rank_true_positives`** — Help assess query precision by ranking SARIF results.

### Workshop Creation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[2026-01-20 15:00:00] [SPAMMY] execute query-server2> runQuery called with /workspace/src/SqlInjection.ql
[2026-01-20 15:00:01] Calling plumbing command: codeql resolve upgrades --dbscheme=/databases/test-python-db/db-python/semmlecode.python.dbscheme --format=json
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading