go-sdk/mcp/testdata/conformance/server/tools.txtar
Jonathan Amsterdam c132621eb0
jsonschema: marshal to bools (#247)
Marshal the empty schema to true, and its negation to false.

This is technically a breaking behavior change, but a properly written
consumer of JSON Schema will not notice.

For #244.

Fixes #230.
2025-08-06 11:41:02 -04:00

90 lines
1.5 KiB
Text

Check behavior of a server with just tools.
Fixed bugs:
- "tools/list" can have missing params
- "_meta" should not be nil
- empty resource or prompts should not be returned as 'null'
- the server should not crash when params are passed to tools/call
-- tools --
greet
-- client --
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": { "name": "ExampleClient", "version": "1.0.0" }
}
}
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list" }
{ "jsonrpc": "2.0", "id": 3, "method": "resources/list" }
{ "jsonrpc": "2.0", "id": 4, "method": "prompts/list" }
{ "jsonrpc": "2.0", "id": 5, "method": "tools/call" }
-- server --
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capabilities": {
"logging": {},
"tools": {
"listChanged": true
}
},
"protocolVersion": "2024-11-05",
"serverInfo": {
"name": "testServer",
"version": "v1.0.0"
}
}
}
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"description": "say hi",
"inputSchema": {
"type": "object",
"required": [
"Name"
],
"properties": {
"Name": {
"type": "string"
}
},
"additionalProperties": false
},
"name": "greet"
}
]
}
}
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"resources": []
}
}
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"prompts": []
}
}
{
"jsonrpc": "2.0",
"id": 5,
"error": {
"code": -32600,
"message": "invalid request: missing required \"params\""
}
}