Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23.0
require (
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/google/go-cmp v0.7.0
github.com/google/jsonschema-go v0.3.0
github.com/google/jsonschema-go v0.4.1
github.com/yosida95/uritemplate/v3 v3.0.2
golang.org/x/oauth2 v0.30.0
golang.org/x/tools v0.34.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/jsonschema-go v0.3.0 h1:6AH2TxVNtk3IlvkkhjrtbUc4S8AvO0Xii0DxIygDg+Q=
github.com/google/jsonschema-go v0.3.0/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
github.com/google/jsonschema-go v0.4.1 h1:7Cq/xS+ykHvL5xMOjL0ONlOytAvAFcZTqDjXwrc4AtQ=
github.com/google/jsonschema-go v0.4.1/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
Expand Down
29 changes: 25 additions & 4 deletions mcp/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,30 @@ func TestToolForSchemas(t *testing.T) {

var (
falseSchema = &schema{Not: &schema{}}
inSchema = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"p": {Type: "integer"}}}
inSchema2 = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"p": {Type: "string"}}}
outSchema = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"b": {Type: "boolean"}}}
outSchema2 = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"b": {Type: "integer"}}}
inSchema = &schema{
Type: "object",
AdditionalProperties: falseSchema,
Properties: map[string]*schema{"p": {Type: "integer"}},
PropertyOrder: []string{"p"},
}
inSchema2 = &schema{
Type: "object",
AdditionalProperties: falseSchema,
Properties: map[string]*schema{"p": {Type: "string"}},
PropertyOrder: []string{"p"},
}
outSchema = &schema{
Type: "object",
AdditionalProperties: falseSchema,
Properties: map[string]*schema{"b": {Type: "boolean"}},
PropertyOrder: []string{"b"},
}
outSchema2 = &schema{
Type: "object",
AdditionalProperties: falseSchema,
Properties: map[string]*schema{"b": {Type: "integer"}},
PropertyOrder: []string{"b"},
}
)

// Infer both schemas.
Expand Down Expand Up @@ -850,6 +870,7 @@ func TestToolForSchemas(t *testing.T) {
"AsOf": {Type: "string"},
"Source": {Type: "string"},
},
PropertyOrder: []string{"Summary", "AsOf", "Source"},
},
"")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ infoWithIcon
"description": "return resourceLink content with Icon",
"inputSchema": {
"type": "object",
"required": [
"In"
],
"properties": {
"In": {
"type": "string",
"description": "the input"
}
},
"required": [
"In"
],
"additionalProperties": false
},
"name": "contentTool",
Expand All @@ -110,14 +110,14 @@ infoWithIcon
"description": "say hi",
"inputSchema": {
"type": "object",
"required": [
"Name"
],
"properties": {
"Name": {
"type": "string"
}
},
"required": [
"Name"
],
"additionalProperties": false
},
"name": "greetWithIcon",
Expand Down
36 changes: 18 additions & 18 deletions mcp/testdata/conformance/server/tools.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ inc
"description": "say hi",
"inputSchema": {
"type": "object",
"required": [
"Name"
],
"properties": {
"Name": {
"type": "string"
}
},
"required": [
"Name"
],
"additionalProperties": false
},
"name": "greet"
Expand All @@ -95,70 +95,70 @@ inc
"name": "inc",
"outputSchema": {
"type": "object",
"required": [
"y"
],
"properties": {
"y": {
"type": "integer"
}
},
"required": [
"y"
],
"additionalProperties": false
}
},
{
"inputSchema": {
"type": "object",
"required": [
"In"
],
"properties": {
"In": {
"type": "string",
"description": "the input"
}
},
"required": [
"In"
],
"additionalProperties": false
},
"name": "structured",
"outputSchema": {
"type": "object",
"required": [
"Out"
],
"properties": {
"Out": {
"type": "string",
"description": "the output"
}
},
"required": [
"Out"
],
"additionalProperties": false
}
},
{
"inputSchema": {
"type": "object",
"required": [
"Now"
],
"properties": {
"Now": {
"type": "string"
}
},
"required": [
"Now"
],
"additionalProperties": false
},
"name": "tomorrow",
"outputSchema": {
"type": "object",
"required": [
"Tomorrow"
],
"properties": {
"Tomorrow": {
"type": "string"
}
},
"required": [
"Tomorrow"
],
"additionalProperties": false
}
}
Expand Down