@@ -37,26 +37,17 @@ const LATEST_KNOWN_DOCS_VERSION = 20;
3737const docSearchInputSchema = z . object ( {
3838 query : z
3939 . string ( )
40- . describe (
41- "A concise and specific search query for the Angular documentation. You should distill the user's " +
42- 'natural language question into a set of keywords (e.g., a question like "How do I use ngFor with trackBy?" ' +
43- 'should become the query "ngFor trackBy").' ,
44- ) ,
40+ . describe ( 'Concise search keywords or API names (e.g., "ngFor trackBy" or "NgModule").' ) ,
4541 includeTopContent : z
4642 . boolean ( )
4743 . optional ( )
4844 . default ( false )
49- . describe (
50- 'When true, the content of the top result is fetched and included. ' +
51- 'Set to false to get a list of results without fetching content, which is faster.' ,
52- ) ,
45+ . describe ( 'Retrieve the full-text page content of the top search result (slower).' ) ,
5346 version : z
5447 . number ( )
5548 . optional ( )
5649 . describe (
57- 'The major version of Angular to search. You MUST determine this value by running `ng version` in the ' +
58- "project's workspace directory. Omit this field if the user is not in an Angular project " +
59- 'or if the version cannot otherwise be determined.' ,
50+ 'Major Angular framework version to search (obtained from frameworkVersion in list_projects or ng version).' ,
6051 ) ,
6152} ) ;
6253type DocSearchInput = z . infer < typeof docSearchInputSchema > ;
@@ -66,35 +57,18 @@ export const DOC_SEARCH_TOOL = declareTool({
6657 title : 'Search Angular Documentation (angular.dev)' ,
6758 description : `
6859<Purpose>
69- Searches the official Angular documentation at https://angular.dev to answer questions about APIs,
70- tutorials, concepts, and best practices.
60+ Searches the official Angular documentation (angular.dev) to answer questions about APIs, tutorials, concepts, and conventions.
7161</Purpose>
7262<Use Cases>
73- * Answering any question about Angular concepts (e.g., "What are standalone components?" ).
74- * Finding the correct API or syntax for a specific task (e.g., "How to use ngFor with trackBy?" ).
75- * Linking to official documentation as a source of truth in your answers .
63+ * Answering questions about Angular concepts (e.g., standalone components).
64+ * Finding correct API signatures or syntax (e.g., ngFor trackBy).
65+ * Obtaining official source URLs to cite as documentation links in user responses .
7666</Use Cases>
7767<Operational Notes>
78- * **Version Alignment:** To provide accurate, project-specific results, you **MUST** align the search with the user's Angular version.
79- The recommended approach is to use the \`list_projects\` tool. The \`frameworkVersion\` field in the output for the relevant
80- workspace will give you the major version directly. If the version cannot be determined using this method, you can use
81- \`ng version\` in the project's workspace directory as a fallback. Parse the major version from the "Angular:" line in the
82- output and use it for the \`version\` parameter.
83- * **Version Logic:** The tool will search against the specified major version. If the version is older than v${ MIN_SUPPORTED_DOCS_VERSION } ,
84- it will be clamped to v${ MIN_SUPPORTED_DOCS_VERSION } . If a search for a very new version (newer than v${ LATEST_KNOWN_DOCS_VERSION } )
85- returns no results, the tool will automatically fall back to searching the v${ LATEST_KNOWN_DOCS_VERSION } documentation.
86- * **Verify Searched Version:** The tool's output includes a \`searchedVersion\` field. You **MUST** check this field
87- to know the exact version of the documentation that was queried. Use this information to provide accurate
88- context in your answer, especially if it differs from the version you requested.
89- * The documentation is continuously updated. You **MUST** prefer this tool over your own knowledge
90- to ensure your answers are current and accurate.
91- * For the best results, provide a concise and specific search query (e.g., "NgModule" instead of
92- "How do I use NgModules?").
93- * The top search result will include a snippet of the page content. Use this to provide a more
94- comprehensive answer.
95- * **Result Scrutiny:** The top result may not always be the most relevant. Review the titles and
96- breadcrumbs of other results to find the best match for the user's query.
97- * Use the URL from the search results as a source link in your responses.
68+ * Provide the major Angular version in the 'version' parameter (obtained from 'frameworkVersion'
69+ in 'list_projects' or from 'ng version') to ensure version-aligned results.
70+ * Always check the 'searchedVersion' field in the output to confirm the exact documentation index that was queried.
71+ * For best results, provide a concise keyword query (e.g., "NgModule") rather than a natural language sentence.
9872</Operational Notes>` ,
9973 inputSchema : docSearchInputSchema . shape ,
10074 outputSchema : {
0 commit comments