Set default content to an empty array instead of nil
Follow-up to https://github.com/modelcontextprotocol/ruby-sdk/pull/147. According to the specification schema, `content` is not optional and therefore cannot be omitted: ```typescript interface CallToolResult { _meta?: { [key: string]: unknown }; content: ContentBlock[]; isError?: boolean; structuredContent?: { [key: string]: unknown }; [key: string]: unknown; } ``` https://modelcontextprotocol.io/specification/2025-06-18/schema#calltoolresult Instead of `nil`, an empty array is set as the default value. There may be a better value for `content`, but at the very least it should not be missing.
This commit is contained in:
parent
010ae74edc
commit
0034952df9
1 changed files with 14 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ module MCP
|
|||
error = deprecated_error
|
||||
end
|
||||
|
||||
@content = content
|
||||
@content = content || []
|
||||
@error = error
|
||||
@structured_content = structured_content
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue