Change default name casing of McpServerXx.Create tools/prompts#568
Change default name casing of McpServerXx.Create tools/prompts#568stephentoub merged 2 commits intomodelcontextprotocol:mainfrom
Conversation
4c442a8 to
5135a11
Compare
eiriktsarpalis
left a comment
There was a problem hiding this comment.
The guidance makes mention of parameters needing to be camelCase. Is this something we'd want to enforce or is it safe to assume parameters will almost always be conformant?
For method names, the .NET guidelines differ, so I think it makes sense to proactively apply a transform. For parameters, the guidance is the same, so I think we just don't bother unless we see notable problems. The name is also much more prominent, in that it's the main thing that someone would use to opt-in / out a tool from being used. |
|
I think applying a transform by default to automatically convert .NET to MCP naming conventions is a great idea. Ideally something that users can remove or override in case it does the wrong thing for specific cases. |
Yes, this is already the case, using either the Name property on the attribute or on the options passed to the Create method. |
halter73
left a comment
There was a problem hiding this comment.
This seems reasonable for now given it follows VS Code guidance. I hope we can change this again in the future without us considering it too breaking.
halter73
left a comment
There was a problem hiding this comment.
This seems reasonable for now given it follows VS Code guidance. I hope we can change this again in the future without us considering it too breaking.
|
Adding the |
Following the guidance at https://code.visualstudio.com/docs/copilot/guides/mcp-developer-guide#_naming-conventions, changes McpServerTool.Create and McpServerPrompt.Create to use lower_snake_case for tools and camelCase for prompts when no name is explicitly specified and we derive a name from the method name.
@timheuer, @halter73, @eiriktsarpalis, @mikekistler, @AArnott, thoughts?