@@ -29,11 +29,13 @@ const getBladeComponentDocsToolSchema = {
2929 . describe (
3030 "The working root directory of the consumer's project. Do not use root directory, do not use '.', only use absolute path to current directory" ,
3131 ) ,
32+ agentName : z . enum ( [ 'claude' , 'cursor' , 'any other agent name' ] ) . optional ( ) . default ( 'cursor' ) ,
3233} ;
3334
3435const getBladeComponentDocsToolCallback : ToolCallback < typeof getBladeComponentDocsToolSchema > = ( {
3536 componentsList,
3637 currentProjectRootDirectory,
38+ agentName,
3739} ) => {
3840 const components = componentsList . split ( ',' ) . map ( ( s ) => s . trim ( ) ) ;
3941 const invalidComponents = components . filter ( ( comp ) => ! bladeComponentsList . includes ( comp ) ) ;
@@ -47,14 +49,14 @@ const getBladeComponentDocsToolCallback: ToolCallback<typeof getBladeComponentDo
4749
4850 const ruleFilePath = join ( currentProjectRootDirectory , CONSUMER_CURSOR_RULES_RELATIVE_PATH ) ;
4951
50- if ( ! existsSync ( ruleFilePath ) ) {
52+ if ( ! existsSync ( ruleFilePath ) && agentName === 'cursor' ) {
5153 return handleError ( {
5254 toolName : getBladeComponentDocsToolName ,
5355 mcpErrorMessage : `Cursor rules do not exist. Call \`${ createBladeCursorRulesToolName } \` first.` ,
5456 } ) ;
5557 }
5658
57- if ( hasOutDatedRules ( ruleFilePath ) ) {
59+ if ( hasOutDatedRules ( ruleFilePath ) && agentName === 'cursor' ) {
5860 return handleError ( {
5961 toolName : getBladeComponentDocsToolName ,
6062 mcpErrorMessage : `Cursor rules are outdated. Call \`${ createBladeCursorRulesToolName } \` first to update cursor rules` ,
@@ -74,6 +76,7 @@ const getBladeComponentDocsToolCallback: ToolCallback<typeof getBladeComponentDo
7476 toolName : getBladeComponentDocsToolName ,
7577 componentsList,
7678 rootDirectoryName : basename ( currentProjectRootDirectory ) ,
79+ agentName,
7780 } ,
7881 } ) ;
7982
0 commit comments