feat(@angular/cli): make find_examples tool version-aware#31546
Merged
clydin merged 3 commits intoangular:mainfrom Oct 22, 2025
Merged
feat(@angular/cli): make find_examples tool version-aware#31546clydin merged 3 commits intoangular:mainfrom
clydin merged 3 commits intoangular:mainfrom
Conversation
This commit refactors the `find_examples` MCP tool to be version-aware, aligning its behavior with the `get_best_practices` tool. The tool now dynamically resolves the code examples database from the user's installed version of `@angular/core`, ensuring that the provided examples are accurate for their specific project version. Key changes: - The input schema is updated to accept a `workspacePath`. - New logic reads the `angular.examples` metadata from `@angular/core/package.json` to locate the version-specific SQLite database. - If the version-specific database cannot be resolved, the tool gracefully falls back to the generic database bundled with the CLI. - The database querying logic has been extracted into a separate helper function for better code organization.
…error This commit fixes a runtime error in the `find_examples` tool that occurred when filtering examples. The error `no such column: experimental` was caused by an incorrect SQL query that attempted to access a column on the FTS virtual table (`examples_fts`) that only exists on the main content table (`examples`). The fix refactors the database query to use a `JOIN` between the `examples` and `examples_fts` tables. This allows the `WHERE` clause to correctly filter on the `experimental` column from the main table while still leveraging the full-text search capabilities of the virtual table.
This commit fixes a bug in the YAML frontmatter parsing logic that caused string values in arrays to be double-quoted. The issue was present in both the `find_examples` MCP tool's runtime parser and the `example_db_generator.js` script. The `parseFrontmatter` function in both files has been updated to correctly unquote string values, ensuring that the structured data in the examples database is clean and the tool's output is formatted correctly.
hybrist
approved these changes
Oct 22, 2025
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This commit refactors the
find_examplesMCP tool to be version-aware, aligning its behavior with theget_best_practicestool. The tool now dynamically resolves the code examples database from the user's installed version of@angular/core, ensuring that the provided examples are accurate for their specific project version.Key changes:
workspacePath.angular.examplesmetadata from@angular/core/package.jsonto locate the version-specific SQLite database.