Skip to content

[MCP] Audit and improve XML doc comments for AI accuracy #4777

@AClerbois

Description

@AClerbois

Summary

The Fluent UI Blazor MCP server serves component documentation built directly from C# XML doc comments (<summary>, <remarks>, <example>) on [Parameter] properties. When an AI model calls GetComponentDetails("FluentTab"), it receives those descriptions verbatim and uses them to determine which attribute to write in generated code.

Problem

When a property's <summary> uses terminology that differs from the actual property name, AI models can generate incorrect attribute names.

Example — FluentTab.Header:

Before (v5 RC2), the property was named Label and its description said "the text label shown in the tab strip". After renaming to Header, the description still referenced "label" — causing an AI to write Label="My Tab" instead of Header="My Tab".

This class of mismatch silently produces non-compiling or functionally wrong Blazor code.

Criteria for review

Each [Parameter] property doc comment is evaluated on:

  1. Name/description mismatch — description uses different terminology than the property name
  2. Ambiguity — description is too generic to distinguish from sibling properties (e.g., two properties both described as "the content")
  3. Missing cross-references — related/alternative properties not referenced via <see cref="..."/>
  4. Undocumented renames — v4→v5 property renames not clearly stated in <remarks>
  5. Missing usage example — no inline <c>PropertyName="value"</c> example to anchor the description

Fix pattern

/// <summary>
/// Gets or sets the text displayed on the tab strip label (e.g., <c>Header="My Tab"</c>).
/// For rich content with icons or custom markup, use <see cref="HeaderTemplate"/> instead.
/// </summary>
/// <remarks>Renamed from <c>Label</c> in v4.</remarks>
[Parameter]
public string? Header { get; set; }

Scope

All 55 component folders under src/Core/Components/ will be audited. A separate PR will be opened for each component where issues are found, linked back to this tracking issue.

Components

Accordion, AppBar, Avatar, Badge, Button, Card, Checkbox, DataGrid, DateTime, Dialog, Divider, Drag, ErrorBoundary, Field, Forms, Grid, Highlighter, Icons, Image, InputFile, KeyCode, Label, Layout, Link, List, Menu, MessageBar, Nav, NumberInput, Overflow, Overlay, Pagination, Popover, Progress, PullToRefresh, Radio, RatingDisplay, Skeleton, Slider, SortableList, Spacer, Splitter, Stack, Switch, Tabs, Text, TextArea, TextInput, Theme, Toast, Tooltip, TreeView, Wizard

Related

Per-component PRs will be opened with the branch prefix users/aclerbois/dev-v5/fix-mcp-docs-{component} and will reference this issue.

Metadata

Metadata

Assignees

Labels

v5For the next major version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions