@@ -47,12 +47,6 @@ class Mcp < OpenAI::Internal::Type::BaseModel
47
47
# @return [String]
48
48
required :server_label , String
49
49
50
- # @!attribute server_url
51
- # The URL for the MCP server.
52
- #
53
- # @return [String]
54
- required :server_url , String
55
-
56
50
# @!attribute type
57
51
# The type of the MCP tool. Always `mcp`.
58
52
#
@@ -62,9 +56,37 @@ class Mcp < OpenAI::Internal::Type::BaseModel
62
56
# @!attribute allowed_tools
63
57
# List of allowed tool names or a filter object.
64
58
#
65
- # @return [Array<String>, OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpAllowedToolsFilter , nil]
59
+ # @return [Array<String>, OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpToolFilter , nil]
66
60
optional :allowed_tools , union : -> { OpenAI ::Responses ::Tool ::Mcp ::AllowedTools } , nil? : true
67
61
62
+ # @!attribute authorization
63
+ # An OAuth access token that can be used with a remote MCP server, either with a
64
+ # custom MCP server URL or a service connector. Your application must handle the
65
+ # OAuth authorization flow and provide the token here.
66
+ #
67
+ # @return [String, nil]
68
+ optional :authorization , String
69
+
70
+ # @!attribute connector_id
71
+ # Identifier for service connectors, like those available in ChatGPT. One of
72
+ # `server_url` or `connector_id` must be provided. Learn more about service
73
+ # connectors
74
+ # [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
75
+ #
76
+ # Currently supported `connector_id` values are:
77
+ #
78
+ # - Dropbox: `connector_dropbox`
79
+ # - Gmail: `connector_gmail`
80
+ # - Google Calendar: `connector_googlecalendar`
81
+ # - Google Drive: `connector_googledrive`
82
+ # - Microsoft Teams: `connector_microsoftteams`
83
+ # - Outlook Calendar: `connector_outlookcalendar`
84
+ # - Outlook Email: `connector_outlookemail`
85
+ # - SharePoint: `connector_sharepoint`
86
+ #
87
+ # @return [Symbol, OpenAI::Models::Responses::Tool::Mcp::ConnectorID, nil]
88
+ optional :connector_id , enum : -> { OpenAI ::Responses ::Tool ::Mcp ::ConnectorID }
89
+
68
90
# @!attribute headers
69
91
# Optional HTTP headers to send to the MCP server. Use for authentication or other
70
92
# purposes.
@@ -84,7 +106,14 @@ class Mcp < OpenAI::Internal::Type::BaseModel
84
106
# @return [String, nil]
85
107
optional :server_description , String
86
108
87
- # @!method initialize(server_label:, server_url:, allowed_tools: nil, headers: nil, require_approval: nil, server_description: nil, type: :mcp)
109
+ # @!attribute server_url
110
+ # The URL for the MCP server. One of `server_url` or `connector_id` must be
111
+ # provided.
112
+ #
113
+ # @return [String, nil]
114
+ optional :server_url , String
115
+
116
+ # @!method initialize(server_label:, allowed_tools: nil, authorization: nil, connector_id: nil, headers: nil, require_approval: nil, server_description: nil, server_url: nil, type: :mcp)
88
117
# Some parameter documentations has been truncated, see
89
118
# {OpenAI::Models::Responses::Tool::Mcp} for more details.
90
119
#
@@ -94,16 +123,20 @@ class Mcp < OpenAI::Internal::Type::BaseModel
94
123
#
95
124
# @param server_label [String] A label for this MCP server, used to identify it in tool calls.
96
125
#
97
- # @param server_url [String] The URL for the MCP server.
126
+ # @param allowed_tools [Array<String>, OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpToolFilter, nil] List of allowed tool names or a filter object.
127
+ #
128
+ # @param authorization [String] An OAuth access token that can be used with a remote MCP server, either
98
129
#
99
- # @param allowed_tools [Array<String> , OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpAllowedToolsFilter, nil] List of allowed tool names or a filter object.
130
+ # @param connector_id [Symbol , OpenAI::Models::Responses::Tool::Mcp::ConnectorID] Identifier for service connectors, like those available in ChatGPT. One of
100
131
#
101
132
# @param headers [Hash{Symbol=>String}, nil] Optional HTTP headers to send to the MCP server. Use for authentication
102
133
#
103
134
# @param require_approval [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalSetting, nil] Specify which of the MCP server's tools require approval.
104
135
#
105
136
# @param server_description [String] Optional description of the MCP server, used to provide more context.
106
137
#
138
+ # @param server_url [String] The URL for the MCP server. One of `server_url` or `connector_id` must be
139
+ #
107
140
# @param type [Symbol, :mcp] The type of the MCP tool. Always `mcp`.
108
141
109
142
# List of allowed tool names or a filter object.
@@ -116,34 +149,85 @@ module AllowedTools
116
149
variant -> { OpenAI ::Models ::Responses ::Tool ::Mcp ::AllowedTools ::StringArray }
117
150
118
151
# A filter object to specify which tools are allowed.
119
- variant -> { OpenAI ::Responses ::Tool ::Mcp ::AllowedTools ::McpAllowedToolsFilter }
152
+ variant -> { OpenAI ::Responses ::Tool ::Mcp ::AllowedTools ::McpToolFilter }
153
+
154
+ class McpToolFilter < OpenAI ::Internal ::Type ::BaseModel
155
+ # @!attribute read_only
156
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
157
+ # is
158
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
159
+ # it will match this filter.
160
+ #
161
+ # @return [Boolean, nil]
162
+ optional :read_only , OpenAI ::Internal ::Type ::Boolean
120
163
121
- class McpAllowedToolsFilter < OpenAI ::Internal ::Type ::BaseModel
122
164
# @!attribute tool_names
123
165
# List of allowed tool names.
124
166
#
125
167
# @return [Array<String>, nil]
126
168
optional :tool_names , OpenAI ::Internal ::Type ::ArrayOf [ String ]
127
169
128
- # @!method initialize(tool_names: nil)
170
+ # @!method initialize(read_only: nil, tool_names: nil)
171
+ # Some parameter documentations has been truncated, see
172
+ # {OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpToolFilter} for more
173
+ # details.
174
+ #
129
175
# A filter object to specify which tools are allowed.
130
176
#
177
+ # @param read_only [Boolean] Indicates whether or not a tool modifies data or is read-only. If an
178
+ #
131
179
# @param tool_names [Array<String>] List of allowed tool names.
132
180
end
133
181
134
182
# @!method self.variants
135
- # @return [Array(Array<String>, OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpAllowedToolsFilter )]
183
+ # @return [Array(Array<String>, OpenAI::Models::Responses::Tool::Mcp::AllowedTools::McpToolFilter )]
136
184
137
185
# @type [OpenAI::Internal::Type::Converter]
138
186
StringArray = OpenAI ::Internal ::Type ::ArrayOf [ String ]
139
187
end
140
188
189
+ # Identifier for service connectors, like those available in ChatGPT. One of
190
+ # `server_url` or `connector_id` must be provided. Learn more about service
191
+ # connectors
192
+ # [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
193
+ #
194
+ # Currently supported `connector_id` values are:
195
+ #
196
+ # - Dropbox: `connector_dropbox`
197
+ # - Gmail: `connector_gmail`
198
+ # - Google Calendar: `connector_googlecalendar`
199
+ # - Google Drive: `connector_googledrive`
200
+ # - Microsoft Teams: `connector_microsoftteams`
201
+ # - Outlook Calendar: `connector_outlookcalendar`
202
+ # - Outlook Email: `connector_outlookemail`
203
+ # - SharePoint: `connector_sharepoint`
204
+ #
205
+ # @see OpenAI::Models::Responses::Tool::Mcp#connector_id
206
+ module ConnectorID
207
+ extend OpenAI ::Internal ::Type ::Enum
208
+
209
+ CONNECTOR_DROPBOX = :connector_dropbox
210
+ CONNECTOR_GMAIL = :connector_gmail
211
+ CONNECTOR_GOOGLECALENDAR = :connector_googlecalendar
212
+ CONNECTOR_GOOGLEDRIVE = :connector_googledrive
213
+ CONNECTOR_MICROSOFTTEAMS = :connector_microsoftteams
214
+ CONNECTOR_OUTLOOKCALENDAR = :connector_outlookcalendar
215
+ CONNECTOR_OUTLOOKEMAIL = :connector_outlookemail
216
+ CONNECTOR_SHAREPOINT = :connector_sharepoint
217
+
218
+ # @!method self.values
219
+ # @return [Array<Symbol>]
220
+ end
221
+
141
222
# Specify which of the MCP server's tools require approval.
142
223
#
143
224
# @see OpenAI::Models::Responses::Tool::Mcp#require_approval
144
225
module RequireApproval
145
226
extend OpenAI ::Internal ::Type ::Union
146
227
228
+ # Specify which of the MCP server's tools require approval. Can be
229
+ # `always`, `never`, or a filter object associated with tools
230
+ # that require approval.
147
231
variant -> { OpenAI ::Responses ::Tool ::Mcp ::RequireApproval ::McpToolApprovalFilter }
148
232
149
233
# Specify a single approval policy for all tools. One of `always` or
@@ -153,13 +237,13 @@ module RequireApproval
153
237
154
238
class McpToolApprovalFilter < OpenAI ::Internal ::Type ::BaseModel
155
239
# @!attribute always
156
- # A list of tools that always require approval .
240
+ # A filter object to specify which tools are allowed .
157
241
#
158
242
# @return [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always, nil]
159
243
optional :always , -> { OpenAI ::Responses ::Tool ::Mcp ::RequireApproval ::McpToolApprovalFilter ::Always }
160
244
161
245
# @!attribute never
162
- # A list of tools that never require approval .
246
+ # A filter object to specify which tools are allowed .
163
247
#
164
248
# @return [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never, nil]
165
249
optional :never , -> { OpenAI ::Responses ::Tool ::Mcp ::RequireApproval ::McpToolApprovalFilter ::Never }
@@ -169,36 +253,69 @@ class McpToolApprovalFilter < OpenAI::Internal::Type::BaseModel
169
253
# {OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter}
170
254
# for more details.
171
255
#
172
- # @param always [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always] A list of tools that always require approval.
256
+ # Specify which of the MCP server's tools require approval. Can be `always`,
257
+ # `never`, or a filter object associated with tools that require approval.
258
+ #
259
+ # @param always [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always] A filter object to specify which tools are allowed.
173
260
#
174
- # @param never [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never] A list of tools that never require approval .
261
+ # @param never [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never] A filter object to specify which tools are allowed .
175
262
176
263
# @see OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter#always
177
264
class Always < OpenAI ::Internal ::Type ::BaseModel
265
+ # @!attribute read_only
266
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
267
+ # is
268
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
269
+ # it will match this filter.
270
+ #
271
+ # @return [Boolean, nil]
272
+ optional :read_only , OpenAI ::Internal ::Type ::Boolean
273
+
178
274
# @!attribute tool_names
179
- # List of tools that require approval .
275
+ # List of allowed tool names .
180
276
#
181
277
# @return [Array<String>, nil]
182
278
optional :tool_names , OpenAI ::Internal ::Type ::ArrayOf [ String ]
183
279
184
- # @!method initialize(tool_names: nil)
185
- # A list of tools that always require approval.
280
+ # @!method initialize(read_only: nil, tool_names: nil)
281
+ # Some parameter documentations has been truncated, see
282
+ # {OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always}
283
+ # for more details.
284
+ #
285
+ # A filter object to specify which tools are allowed.
186
286
#
187
- # @param tool_names [Array<String>] List of tools that require approval.
287
+ # @param read_only [Boolean] Indicates whether or not a tool modifies data or is read-only. If an
288
+ #
289
+ # @param tool_names [Array<String>] List of allowed tool names.
188
290
end
189
291
190
292
# @see OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter#never
191
293
class Never < OpenAI ::Internal ::Type ::BaseModel
294
+ # @!attribute read_only
295
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
296
+ # is
297
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
298
+ # it will match this filter.
299
+ #
300
+ # @return [Boolean, nil]
301
+ optional :read_only , OpenAI ::Internal ::Type ::Boolean
302
+
192
303
# @!attribute tool_names
193
- # List of tools that do not require approval .
304
+ # List of allowed tool names .
194
305
#
195
306
# @return [Array<String>, nil]
196
307
optional :tool_names , OpenAI ::Internal ::Type ::ArrayOf [ String ]
197
308
198
- # @!method initialize(tool_names: nil)
199
- # A list of tools that never require approval.
309
+ # @!method initialize(read_only: nil, tool_names: nil)
310
+ # Some parameter documentations has been truncated, see
311
+ # {OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never}
312
+ # for more details.
313
+ #
314
+ # A filter object to specify which tools are allowed.
315
+ #
316
+ # @param read_only [Boolean] Indicates whether or not a tool modifies data or is read-only. If an
200
317
#
201
- # @param tool_names [Array<String>] List of tools that do not require approval .
318
+ # @param tool_names [Array<String>] List of allowed tool names .
202
319
end
203
320
end
204
321
0 commit comments