Skip to content

Commit 468c7c7

Browse files
Copilotstephentoub
andcommitted
Add StringSyntax attribute to Value property and fix sample code to use escaped quotes
Co-authored-by: stephentoub <[email protected]>
1 parent f42c35e commit 468c7c7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

samples/AspNetCoreMcpServer/Tools/WeatherTools.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public async Task<string> GetAlerts(
4848
}
4949

5050
[McpServerTool, Description("Get weather forecast for a location.")]
51-
[McpMeta("category", "weather")]
52-
[McpMeta("recommendedModel", "gpt-4")]
51+
[McpMeta("category", "\"weather\"")]
52+
[McpMeta("recommendedModel", "\"gpt-4\"")]
5353
public async Task<string> GetForecast(
5454
[Description("Latitude of the location.")] double latitude,
5555
[Description("Longitude of the location.")] double longitude)

src/ModelContextProtocol.Core/Server/McpMetaAttribute.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ public McpMetaAttribute(string name, [StringSyntax(StringSyntaxAttribute.Json)]
6868
/// property to provide a JsonObject directly.
6969
/// </para>
7070
/// </remarks>
71+
[StringSyntax(StringSyntaxAttribute.Json)]
7172
public string Value { get; }
7273
}

0 commit comments

Comments
 (0)