@@ -87,7 +87,7 @@ func loadToolDefinitions(data []byte) (map[string]*ToolDef, error) {
8787 for _ , t := range defs .Tools {
8888 // normalize the raw mcp tool name to be without the mcp identifiers
8989 rawName := t .Name
90- name , _ := strings .CutPrefix (rawName , "sg_" )
90+ name := strings .TrimPrefix (rawName , "sg_" )
9191 name = strings .ReplaceAll (name , "_" , "-" )
9292
9393 tool := & ToolDef {
@@ -140,7 +140,7 @@ func (d *decoder) decodeSchema(r *RawSchema) SchemaValue {
140140 if err := json .Unmarshal (r .Items , & itemRaw ); err == nil {
141141 items = d .decodeSchema (& itemRaw )
142142 } else {
143- d .errors = append (d .errors , errors .Errorf ( "failed to unmarshal array items: %w" , err ))
143+ d .errors = append (d .errors , errors .Wrapf ( err , "failed to unmarshal array items" ))
144144 }
145145 }
146146 }
@@ -162,7 +162,7 @@ func (d *decoder) decodeProperties(props map[string]json.RawMessage) map[string]
162162 for name , raw := range props {
163163 var r RawSchema
164164 if err := json .Unmarshal (raw , & r ); err != nil {
165- d .errors = append (d .errors , errors .Newf ( "failed to parse property %q: %w " , name , err ))
165+ d .errors = append (d .errors , errors .Wrapf ( err , "failed to parse property %q" , name ))
166166 continue
167167 }
168168 res [name ] = d .decodeSchema (& r )
0 commit comments