@@ -28,9 +28,12 @@ export async function createMcpServer(context: {
28
28
'instructions' ,
29
29
'instructions://best-practices' ,
30
30
{
31
- title : 'Angular System Instructions ' ,
31
+ title : 'Angular Best Practices and Code Generation Guide ' ,
32
32
description :
33
- 'A set of instructions to help LLMs generate correct code that follows Angular best practices.' ,
33
+ "A comprehensive guide detailing Angular's best practices for code generation and development. " +
34
+ 'This guide should be used as a reference by an LLM to ensure any generated code ' +
35
+ 'adheres to modern Angular standards, including the use of standalone components, ' +
36
+ 'typed forms, modern control flow syntax, and other current conventions.' ,
34
37
mimeType : 'text/markdown' ,
35
38
} ,
36
39
async ( ) => {
@@ -46,18 +49,26 @@ export async function createMcpServer(context: {
46
49
server . registerTool (
47
50
'list_projects' ,
48
51
{
49
- title : 'List projects ' ,
52
+ title : 'List Angular Projects ' ,
50
53
description :
51
- 'List projects within an Angular workspace.' +
52
- ' This information is read from the `angular.json` file at the root path of the Angular workspace' ,
54
+ 'Lists the names of all applications and libraries defined within an Angular workspace. ' +
55
+ 'It reads the `angular.json` configuration file to identify the projects. ' ,
56
+ annotations : {
57
+ readOnlyHint : true ,
58
+ } ,
53
59
} ,
54
- ( ) => {
55
- if ( ! context . workspace ) {
60
+ async ( ) => {
61
+ const { workspace } = context ;
62
+
63
+ if ( ! workspace ) {
56
64
return {
57
65
content : [
58
66
{
59
- type : 'text' ,
60
- text : 'Not within an Angular project.' ,
67
+ type : 'text' as const ,
68
+ text :
69
+ 'No Angular workspace found.' +
70
+ ' An `angular.json` file, which marks the root of a workspace,' +
71
+ ' could not be located in the current directory or any of its parent directories.' ,
61
72
} ,
62
73
] ,
63
74
} ;
@@ -66,10 +77,8 @@ export async function createMcpServer(context: {
66
77
return {
67
78
content : [
68
79
{
69
- type : 'text' ,
70
- text :
71
- 'Projects in the Angular workspace: ' +
72
- [ ...context . workspace . projects . keys ( ) ] . join ( ',' ) ,
80
+ type : 'text' as const ,
81
+ text : 'Projects in the Angular workspace: ' + [ ...workspace . projects . keys ( ) ] . join ( ',' ) ,
73
82
} ,
74
83
] ,
75
84
} ;
0 commit comments