15
15
"Tool" ,
16
16
"Mcp" ,
17
17
"McpAllowedTools" ,
18
- "McpAllowedToolsMcpAllowedToolsFilter " ,
18
+ "McpAllowedToolsMcpToolFilter " ,
19
19
"McpRequireApproval" ,
20
20
"McpRequireApprovalMcpToolApprovalFilter" ,
21
21
"McpRequireApprovalMcpToolApprovalFilterAlways" ,
29
29
]
30
30
31
31
32
- class McpAllowedToolsMcpAllowedToolsFilter (BaseModel ):
32
+ class McpAllowedToolsMcpToolFilter (BaseModel ):
33
+ read_only : Optional [bool ] = None
34
+ """Indicates whether or not a tool modifies data or is read-only.
35
+
36
+ If an MCP server is
37
+ [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
38
+ it will match this filter.
39
+ """
40
+
33
41
tool_names : Optional [List [str ]] = None
34
42
"""List of allowed tool names."""
35
43
36
44
37
- McpAllowedTools : TypeAlias = Union [List [str ], McpAllowedToolsMcpAllowedToolsFilter , None ]
45
+ McpAllowedTools : TypeAlias = Union [List [str ], McpAllowedToolsMcpToolFilter , None ]
38
46
39
47
40
48
class McpRequireApprovalMcpToolApprovalFilterAlways (BaseModel ):
49
+ read_only : Optional [bool ] = None
50
+ """Indicates whether or not a tool modifies data or is read-only.
51
+
52
+ If an MCP server is
53
+ [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
54
+ it will match this filter.
55
+ """
56
+
41
57
tool_names : Optional [List [str ]] = None
42
- """List of tools that require approval ."""
58
+ """List of allowed tool names ."""
43
59
44
60
45
61
class McpRequireApprovalMcpToolApprovalFilterNever (BaseModel ):
62
+ read_only : Optional [bool ] = None
63
+ """Indicates whether or not a tool modifies data or is read-only.
64
+
65
+ If an MCP server is
66
+ [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
67
+ it will match this filter.
68
+ """
69
+
46
70
tool_names : Optional [List [str ]] = None
47
- """List of tools that do not require approval ."""
71
+ """List of allowed tool names ."""
48
72
49
73
50
74
class McpRequireApprovalMcpToolApprovalFilter (BaseModel ):
51
75
always : Optional [McpRequireApprovalMcpToolApprovalFilterAlways ] = None
52
- """A list of tools that always require approval ."""
76
+ """A filter object to specify which tools are allowed ."""
53
77
54
78
never : Optional [McpRequireApprovalMcpToolApprovalFilterNever ] = None
55
- """A list of tools that never require approval ."""
79
+ """A filter object to specify which tools are allowed ."""
56
80
57
81
58
82
McpRequireApproval : TypeAlias = Union [McpRequireApprovalMcpToolApprovalFilter , Literal ["always" , "never" ], None ]
@@ -62,15 +86,49 @@ class Mcp(BaseModel):
62
86
server_label : str
63
87
"""A label for this MCP server, used to identify it in tool calls."""
64
88
65
- server_url : str
66
- """The URL for the MCP server."""
67
-
68
89
type : Literal ["mcp" ]
69
90
"""The type of the MCP tool. Always `mcp`."""
70
91
71
92
allowed_tools : Optional [McpAllowedTools ] = None
72
93
"""List of allowed tool names or a filter object."""
73
94
95
+ authorization : Optional [str ] = None
96
+ """
97
+ An OAuth access token that can be used with a remote MCP server, either with a
98
+ custom MCP server URL or a service connector. Your application must handle the
99
+ OAuth authorization flow and provide the token here.
100
+ """
101
+
102
+ connector_id : Optional [
103
+ Literal [
104
+ "connector_dropbox" ,
105
+ "connector_gmail" ,
106
+ "connector_googlecalendar" ,
107
+ "connector_googledrive" ,
108
+ "connector_microsoftteams" ,
109
+ "connector_outlookcalendar" ,
110
+ "connector_outlookemail" ,
111
+ "connector_sharepoint" ,
112
+ ]
113
+ ] = None
114
+ """Identifier for service connectors, like those available in ChatGPT.
115
+
116
+ One of `server_url` or `connector_id` must be provided. Learn more about service
117
+ connectors
118
+ [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
119
+
120
+ Currently supported `connector_id` values are:
121
+
122
+ - Dropbox: `connector_dropbox`
123
+ - Gmail: `connector_gmail`
124
+ - Google Calendar: `connector_googlecalendar`
125
+ - Google Drive: `connector_googledrive`
126
+ - Microsoft Teams: `connector_microsoftteams`
127
+ - Outlook Calendar: `connector_outlookcalendar`
128
+ - Outlook Email: `connector_outlookemail`
129
+ - SharePoint: `connector_sharepoint`
130
+ """
131
+
74
132
headers : Optional [Dict [str , str ]] = None
75
133
"""Optional HTTP headers to send to the MCP server.
76
134
@@ -83,6 +141,12 @@ class Mcp(BaseModel):
83
141
server_description : Optional [str ] = None
84
142
"""Optional description of the MCP server, used to provide more context."""
85
143
144
+ server_url : Optional [str ] = None
145
+ """The URL for the MCP server.
146
+
147
+ One of `server_url` or `connector_id` must be provided.
148
+ """
149
+
86
150
87
151
class CodeInterpreterContainerCodeInterpreterToolAuto (BaseModel ):
88
152
type : Literal ["auto" ]
0 commit comments