Skip to content

Commit 128f0d5

Browse files
committed
test(mcp): assert wire-format type field in tool serialization test
The SDK's constant.Function auto-marshals zero to "function", but having an explicit wire-format assertion proves this contract holds. Signed-off-by: asaadbalum <asaad.balum@gmail.com>
1 parent c9980af commit 128f0d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/semantic-router/pkg/mcp/types_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestConvertToolToOpenAI_BasicTool(t *testing.T) {
3737
var parsed map[string]interface{}
3838
require.NoError(t, json.Unmarshal(body, &parsed))
3939

40+
assert.Equal(t, "function", parsed["type"])
4041
fn := parsed["function"].(map[string]interface{})
4142
assert.Equal(t, "get_weather", fn["name"])
4243
params := fn["parameters"].(map[string]interface{})

0 commit comments

Comments
 (0)