package mcpserver import ( "testing" "github.com/google/jsonschema-go/jsonschema" "github.com/modelcontextprotocol/go-sdk/mcp" "git.warky.dev/wdevs/amcs/internal/tools" ) func TestSetToolSchemasUsesStringUUIDsInListOutput(t *testing.T) { tool := &mcp.Tool{Name: "list_thoughts"} if err := setToolSchemas[tools.ListInput, tools.ListOutput](tool); err != nil { t.Fatalf("set tool schemas: %v", err) } schema, ok := tool.OutputSchema.(*jsonschema.Schema) if !ok { t.Fatalf("output schema type = %T, want *jsonschema.Schema", tool.OutputSchema) } thoughtsSchema := schema.Properties["thoughts"] if thoughtsSchema == nil { t.Fatal("missing thoughts schema") } if thoughtsSchema.Items == nil { t.Fatal("missing thoughts item schema") } idSchema := thoughtsSchema.Items.Properties["id"] if idSchema == nil { t.Fatal("missing id schema") } if idSchema.Type != "string" { t.Fatalf("id schema type = %q, want %q", idSchema.Type, "string") } if idSchema.Format != "uuid" { t.Fatalf("id schema format = %q, want %q", idSchema.Format, "uuid") } }