Skip to content

Commit ea6fb05

Browse files
committed
Address PR feedback
1 parent 7d1bce8 commit ea6fb05

File tree

3 files changed

+1131
-301
lines changed

3 files changed

+1131
-301
lines changed

src/ModelContextProtocol.Analyzers/Diagnostics.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@ internal static class Diagnostics
1919
defaultSeverity: DiagnosticSeverity.Warning,
2020
isEnabledByDefault: true,
2121
description: "The XML documentation comment contains invalid XML and cannot be processed to generate Description attributes.");
22+
23+
public static DiagnosticDescriptor McpMethodMustBePartial { get; } = new(
24+
id: "MCP002",
25+
title: "MCP method must be partial to generate [Description] attributes",
26+
messageFormat: "Method '{0}' has XML documentation that could be used to generate [Description] attributes, but the method is not declared as partial.",
27+
category: "mcp",
28+
defaultSeverity: DiagnosticSeverity.Warning,
29+
isEnabledByDefault: true,
30+
description: "Methods with MCP attributes should be declared as partial to allow the source generator to emit Description attributes from XML documentation comments.");
2231
}

0 commit comments

Comments
 (0)