Skip to content

Commit 6de63f5

Browse files
committed
Cleanup
1 parent 2e077dc commit 6de63f5

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,12 @@ private static McpServerToolCreateOptions DeriveOptions(MethodInfo method, McpSe
177177
newOptions.ReadOnly ??= readOnly;
178178
}
179179

180-
newOptions.UseStructuredContent = toolAttr.UseStructuredContent;
181-
182-
// Handle icon from attribute if not already specified in options
183-
if (newOptions.Icons is null && !string.IsNullOrEmpty(toolAttr.IconSource))
180+
if (toolAttr.IconSource is { Length: > 0 } iconSource)
184181
{
185-
newOptions.Icons = new List<Icon>
186-
{
187-
new() { Source = toolAttr.IconSource }
188-
};
182+
newOptions.Icons ??= [new() { Source = iconSource }];
189183
}
184+
185+
newOptions.UseStructuredContent = toolAttr.UseStructuredContent;
190186
}
191187

192188
if (method.GetCustomAttribute<DescriptionAttribute>() is { } descAttr)

0 commit comments

Comments
 (0)