Repository navigation
feat: add tool annotation - #226
Merged
Merged
Conversation
…d consistency and cache management
…ules and improve pnpm installation command
Contributor
Reviewer's GuideThis PR introduces optional tool annotations by extending config structs, mapping them into the MCP schema, updating server types and SSE handling, and providing utility functions with tests for safe extraction of annotation values. Class diagram for ToolConfig and ToolSchema with AnnotationsclassDiagram
class ToolConfig {
string Name
string Description
string RequestBody
string ResponseBody
map[string]any InputSchema
map[string]any Annotations // newly added
ToToolSchema() mcp.ToolSchema
}
class ToolSchema {
string Name
string Description
ToolInputSchema InputSchema
ToolAnnotations* Annotations // newly added
}
class ToolAnnotations {
bool DestructiveHint
bool IdempotentHint
bool OpenWorldHint
bool ReadOnlyHint
string Title
}
ToolConfig --|> ToolSchema : ToToolSchema()
ToolSchema o-- ToolAnnotations : optional
Class diagram for utility functions in utils packageclassDiagram
class utils {
+GetBool(map[string]any, string, bool) bool
+GetString(map[string]any, string, string) string
}
Class diagram for updated PromptConfig and PromptSchemaclassDiagram
class PromptConfig {
string Name
string Description
[]PromptArgument Arguments
[]PromptResponse PromptResponse
ToPromptSchema() mcp.PromptSchema
}
class PromptSchema {
string Name
string Description
[]PromptArgumentSchema Arguments
[]PromptResponseSchema PromptResponse
}
PromptConfig --|> PromptSchema : ToPromptSchema()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @qiankunli - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add support for optional tool annotations across config, MCP schemas, and SSE server handling, and introduce map utility functions with corresponding tests
New Features:
Enhancements:
Tests: