Add support for complex types in McpToolProperty with snippets examples#33
Add support for complex types in McpToolProperty with snippets examples#33
Conversation
Co-authored-by: paulyuk <1968137+paulyuk@users.noreply.github.com>
|
@copilot Please recommend the smallest change that also shows a working property similar to what @jonas-tian mentions. The theme of this sample is working with snippets, so suggest one more new tool/function that works with a more complex type like a snippets array (perhaps a function that lists all snippets?). Please do not add any examples that are off topic or not aligning with theme, like order-items. |
|
@copilot - Ignore the idea around Order tools and order-items. Please restart this PR and only use this instruction: Please recommend the smallest change that also shows a working property similar to what @jonas-tian mentions but sticking to the Snippets tool and theme. The theme of this sample is working with snippets, so suggest one more new tool/function that works with a more complex type like a snippets array (perhaps a function that lists all snippets?). Please do not add any examples that are off topic or not aligning with theme, like order-items. |
Co-authored-by: paulyuk <1968137+paulyuk@users.noreply.github.com>
I've implemented the requested changes. Removed the off-topic OrderTool and added two snippets-focused functions that demonstrate complex types:
Both stay completely on theme with the snippets concept while showing practical usage of array, object, and boolean property types. The examples are much more minimal and aligned with the existing codebase theme. Commit: Replace OrderTool with snippets-focused complex type examples |
This PR implements support for complex data types in
McpToolProperty, enabling developers to define array, object, number, and boolean parameters instead of being limited to string types only.What's Changed
New Property Type Constants
Added comprehensive type constants in
ToolsInformation.cs:ArrayPropertyType- for arrays and listsObjectPropertyType- for complex objectsNumberPropertyType- for numeric dataBooleanPropertyType- for true/false valuesStringPropertyType- for text data (replacing genericPropertyType)Snippets-Focused Examples
Enhanced
SnippetsTool.cswith practical examples demonstrating complex type usage:Enhanced Documentation
Updated README.md with comprehensive examples showing:
Backward Compatibility
All existing code continues to work unchanged. The original
PropertyTypeconstant is preserved, and existing tools using string parameters require no modifications.This change directly addresses the original issue request for defining complex types like arrays and objects while maintaining focus on the repository's core snippet management functionality.
Fixes #28.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.