Skip to content

Comments

Make Tool.Name required to match other protocol types#1351

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-tool-name-consistency
Open

Make Tool.Name required to match other protocol types#1351
Copilot wants to merge 2 commits intomainfrom
copilot/fix-tool-name-consistency

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

Tool.Name used string Name { get; set; } = string.Empty while Prompt.Name, Resource.Name, ResourceTemplate.Name, and PromptArgument.Name all use required string Name. This allowed constructing a Tool with an empty-string name without a compiler warning.

  • Changed Tool.Name to required string Name { get; set; } to match all other IBaseMetadata implementations
  • Updated three test sites in ToolTests.cs that constructed Tool without setting Name

Breaking change: callers must now specify Name in object initializers.

// Before: compiles silently with empty name
var tool = new Tool();

// After: compiler error CS9035, Name is required
var tool = new Tool { Name = "my_tool" };

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…Template.Name, and PromptArgument.Name

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Tool.Name to required string for consistency Make Tool.Name required to match other protocol types Feb 21, 2026
Copilot AI requested a review from stephentoub February 21, 2026 20:31
@stephentoub stephentoub marked this pull request as ready for review February 22, 2026 00:23
@stephentoub stephentoub added the breaking-change This issue or PR introduces a breaking change label Feb 22, 2026
@stephentoub stephentoub added this to the 1.0.0 (GA) milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This issue or PR introduces a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants