mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-04 10:48:20 +00:00
Merge pull request #1521 from lukiod/test/mcp-fuzz-wrong-types
test: cover wrong JSON types in the MCP robustness layer
This commit is contained in:
1 file changed
+13
@@ -115,6 +115,19 @@ test_payload "wrong jsonrpc version" '{"jsonrpc":"1.0","id":2,"method":"tools/ca
|
||||
test_payload "array instead of object" '[1,2,3]'
|
||||
test_payload "deeply nested json" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_graph","arguments":{"name_pattern":{"a":{"b":{"c":{"d":{"e":{"f":"deep"}}}}}}}}}'
|
||||
|
||||
echo ""
|
||||
echo "--- Wrong JSON types ---"
|
||||
|
||||
test_payload "null tool name" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":null,"arguments":{}}}'
|
||||
test_payload "numeric tool name" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":42,"arguments":{}}}'
|
||||
test_payload "object tool name" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":{"a":1},"arguments":{}}}'
|
||||
test_payload "array arguments" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_graph","arguments":[1,2]}}'
|
||||
test_payload "string arguments" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_graph","arguments":"nope"}}'
|
||||
test_payload "null arguments" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_graph","arguments":null}}'
|
||||
test_payload "array params" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":[1,2]}'
|
||||
test_payload "numeric params" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":7}'
|
||||
test_payload "numeric method" '{"jsonrpc":"2.0","id":2,"method":7,"params":{}}'
|
||||
|
||||
echo ""
|
||||
echo "--- Oversized inputs ---"
|
||||
|
||||
|
||||
Reference in new issue
Block a user