@@ -49,6 +49,9 @@ type Tool struct {
4949 // InputSchema defines the expected parameters for the tool using JSON Schema
5050 InputSchema InputSchema `json:"inputSchema"`
5151
52+ // OutputSchema defines expected output structure for the tool using Optional JSON Schema
53+ OutputSchema OutputSchema `json:"outputSchema"`
54+
5255 // Annotations provides additional hints about the tool's behavior
5356 Annotations * ToolAnnotations `json:"annotations,omitempty"`
5457
@@ -82,6 +85,10 @@ func (t *Tool) MarshalJSON() ([]byte, error) {
8285 m ["inputSchema" ] = t .InputSchema
8386 }
8487
88+ if t .OutputSchema .Properties != nil {
89+ m ["outputSchema" ] = t .OutputSchema
90+ }
91+
8592 // Add annotations if present
8693 if t .Annotations != nil {
8794 m ["annotations" ] = t .Annotations
@@ -101,6 +108,9 @@ type InputSchema struct {
101108 Required []string `json:"required,omitempty"`
102109}
103110
111+ // OutputSchema represents a Optional JSON Schema object defining expected output structure for a tool
112+ type OutputSchema InputSchema
113+
104114// CallToolRequest represents a request to call a specific tool
105115type CallToolRequest struct {
106116 Meta map [string ]interface {} `json:"_meta,omitempty"`
0 commit comments