inputSchema interface requires type key
When defining a tool without any arguments taken, it should be allowed
to not have to define the `input_schema` at all, and the default value
for such a scenario should be `{ type: "object" }` as per the schema.
16d91abb68/schema/2025-06-18/schema.ts (L896-L900)
This commit is contained in:
parent
4ba1e2b7f4
commit
2508defc79
1 changed files with 38 additions and 6 deletions
|
|
@ -6,7 +6,6 @@ module MCP
|
|||
NOT_SET = Object.new
|
||||
|
||||
attr_reader :description_value
|
||||
attr_reader :input_schema_value
|
||||
attr_reader :annotations_value
|
||||
|
||||
def call(*args, server_context: nil)
|
||||
|
|
@ -43,6 +42,10 @@ module MCP
|
|||
@name_value || StringUtils.handle_from_class_name(name)
|
||||
end
|
||||
|
||||
def input_schema_value
|
||||
@input_schema_value || InputSchema.new
|
||||
end
|
||||
|
||||
def description(value = NOT_SET)
|
||||
if value == NOT_SET
|
||||
@description_value
|
||||
|
|
|
|||
Loading…
Reference in a new issue