Skip to content

Commit 675bcd4

Browse files
committed
stash schema
1 parent 3a41bd1 commit 675bcd4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/pftools/schema.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ func convertComplexSchemaToToolInput(schemaInfo *SchemaInfo) (*mcp.ToolInputSche
102102
return DefaultStringSchema, nil
103103
}
104104

105-
definitionString, err := json.Marshal(schemaInfo.Definition)
105+
fields, hasFields := schemaInfo.Definition["fields"].([]any)
106+
if !hasFields {
107+
return nil, fmt.Errorf("failed to get fields from schema definition")
108+
}
109+
110+
definitionString, err := json.Marshal(fields)
106111
if err != nil {
107112
return nil, fmt.Errorf("failed to marshal schema definition: %w", err)
108113
}
@@ -113,7 +118,7 @@ func convertComplexSchemaToToolInput(schemaInfo *SchemaInfo) (*mcp.ToolInputSche
113118
Properties: map[string]interface{}{
114119
"payload": map[string]interface{}{
115120
"type": "string",
116-
"description": "The payload of the message, in JSON String format, the schema of the payload is: " + string(definitionString),
121+
"description": "The payload of the message, in JSON String format, the schema of the payload in AVRO format is: " + string(definitionString),
117122
},
118123
},
119124
}, nil

0 commit comments

Comments
 (0)