-
Notifications
You must be signed in to change notification settings - Fork 401
Change default name casing of McpServerXx.Create tools/prompts #568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default name casing of McpServerXx.Create tools/prompts #568
Conversation
4c442a8
to
5135a11
Compare
src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/AIFunctionMcpServerPrompt.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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?