Skip to content

Commit aa44697

Browse files
committed
fix: address greptile review - fix registry spec URLs, remove redundant dep, add error handling
1 parent ede4f91 commit aa44697

File tree

3 files changed

+45
-41
lines changed

3 files changed

+45
-41
lines changed

litellm/proxy/management_endpoints/mcp_management_endpoints.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,6 @@ def _load_openapi_registry() -> Dict[str, Any]:
13841384
@router.get(
13851385
"/openapi-registry",
13861386
description="Returns well-known OpenAPI APIs with OAuth 2.0 metadata for the OpenAPI MCP picker",
1387-
dependencies=[Depends(user_api_key_auth)],
13881387
)
13891388
async def get_openapi_registry(
13901389
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),

litellm/proxy/openapi_registry.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,26 @@
7070
]
7171
},
7272
{
73-
"name": "google",
74-
"title": "Google APIs",
75-
"description": "Gmail, Calendar, Drive, and other Google services",
76-
"icon_url": "https://cdn.simpleicons.org/google",
77-
"spec_url": "https://www.googleapis.com/discovery/v1/apis",
73+
"name": "gmail",
74+
"title": "Gmail",
75+
"description": "Read, send, and manage Gmail messages and threads",
76+
"icon_url": "https://cdn.simpleicons.org/gmail",
77+
"spec_url": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/googleapis.com/gmail/v1/openapi.yaml",
7878
"oauth": {
7979
"authorization_url": "https://accounts.google.com/o/oauth2/v2/auth",
8080
"token_url": "https://oauth2.googleapis.com/token",
8181
"pkce": true,
82-
"docs_url": "https://developers.google.com/identity/protocols/oauth2/web-server"
82+
"docs_url": "https://developers.google.com/gmail/api/auth/about-auth"
8383
},
8484
"key_tools": [
85-
{ "name": "list_messages", "description": "List Gmail messages and threads with search filters" },
85+
{ "name": "list_messages", "description": "List Gmail messages with search filters" },
86+
{ "name": "get_message", "description": "Get the full content of a specific message" },
8687
{ "name": "send_message", "description": "Send an email via Gmail" },
87-
{ "name": "list_events", "description": "List Google Calendar events in a date range" },
88-
{ "name": "create_event", "description": "Create a Calendar event with attendees and video link" },
89-
{ "name": "list_files", "description": "List files and folders in Google Drive" },
90-
{ "name": "get_file", "description": "Get Drive file metadata and download content" },
91-
{ "name": "search_files", "description": "Search Drive files by name, type, or content" },
92-
{ "name": "create_spreadsheet", "description": "Create a new Google Sheets spreadsheet" }
88+
{ "name": "create_draft", "description": "Create a draft email" },
89+
{ "name": "list_labels", "description": "List all labels in the mailbox" },
90+
{ "name": "modify_message", "description": "Add or remove labels from a message" },
91+
{ "name": "list_threads", "description": "List email threads" },
92+
{ "name": "trash_message", "description": "Move a message to trash" }
9393
]
9494
},
9595
{
@@ -118,7 +118,7 @@
118118
{
119119
"name": "hubspot",
120120
"title": "HubSpot",
121-
"description": "CRM contacts, deals, companies, and marketing automation",
121+
"description": "CRM contacts and properties via the HubSpot Contacts API",
122122
"icon_url": "https://cdn.simpleicons.org/hubspot",
123123
"spec_url": "https://raw.githubusercontent.com/HubSpot/HubSpot-public-api-spec-collection/main/PublicApiSpecs/CRM/Contacts/Rollouts/424/v3/contacts.json",
124124
"oauth": {
@@ -131,19 +131,19 @@
131131
{ "name": "search_contacts", "description": "Search CRM contacts by email, name, or custom properties" },
132132
{ "name": "create_contact", "description": "Create a new CRM contact with properties" },
133133
{ "name": "update_contact", "description": "Update contact properties like lifecycle stage or owner" },
134-
{ "name": "create_deal", "description": "Create a new sales deal linked to a contact or company" },
135-
{ "name": "list_deals", "description": "List deals with stage and pipeline filters" },
136-
{ "name": "create_note", "description": "Log a note or activity against a contact or deal" },
137-
{ "name": "get_pipeline", "description": "Get deal pipeline stages and probabilities" },
138-
{ "name": "associate_objects", "description": "Link CRM objects (e.g. contact → deal → company)" }
134+
{ "name": "get_contact", "description": "Get full details of a specific contact" },
135+
{ "name": "archive_contact", "description": "Archive (soft-delete) a contact record" },
136+
{ "name": "merge_contacts", "description": "Merge two duplicate contact records" },
137+
{ "name": "list_contacts", "description": "List all contacts with pagination" },
138+
{ "name": "get_contact_properties", "description": "Get available contact property definitions" }
139139
]
140140
},
141141
{
142142
"name": "notion",
143143
"title": "Notion",
144144
"description": "Pages, databases, and workspace content in Notion",
145145
"icon_url": "https://cdn.simpleicons.org/notion",
146-
"spec_url": "https://raw.githubusercontent.com/TakashiSasaki/notion-openapi/main/Page/notion_api_page_management_v1.yaml",
146+
"spec_url": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/notion.com/1.0.0/openapi.yaml",
147147
"oauth": {
148148
"authorization_url": "https://api.notion.com/v1/oauth/authorize",
149149
"token_url": "https://api.notion.com/v1/oauth/token",
@@ -187,12 +187,12 @@
187187
{
188188
"name": "shopify",
189189
"title": "Shopify",
190-
"description": "Products, orders, customers, and store management",
190+
"description": "Products, orders, customers, and store management (requires your store subdomain)",
191191
"icon_url": "https://cdn.simpleicons.org/shopify",
192192
"spec_url": "https://raw.githubusercontent.com/allengrant/shopify_openapi/master/shopify_openapi.json",
193193
"oauth": {
194-
"authorization_url": "https://{shop}.myshopify.com/admin/oauth/authorize",
195-
"token_url": "https://{shop}.myshopify.com/admin/oauth/access_token",
194+
"authorization_url": "https://your-store.myshopify.com/admin/oauth/authorize",
195+
"token_url": "https://your-store.myshopify.com/admin/oauth/access_token",
196196
"pkce": false,
197197
"docs_url": "https://shopify.dev/docs/apps/auth/get-access-tokens/authorization-code-grant"
198198
},
@@ -214,8 +214,8 @@
214214
"icon_url": "https://cdn.simpleicons.org/snowflake",
215215
"spec_url": "https://raw.githubusercontent.com/snowflakedb/snowflake-rest-api-specs/refs/heads/main/specifications/sqlapi.yaml",
216216
"oauth": {
217-
"authorization_url": "https://<account>.snowflakecomputing.com/oauth/authorize",
218-
"token_url": "https://<account>.snowflakecomputing.com/oauth/token-request",
217+
"authorization_url": "https://your-account.snowflakecomputing.com/oauth/authorize",
218+
"token_url": "https://your-account.snowflakecomputing.com/oauth/token-request",
219219
"pkce": false,
220220
"docs_url": "https://docs.snowflake.com/en/user-guide/oauth-custom"
221221
},

ui/litellm-dashboard/src/components/networking.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6252,24 +6252,29 @@ export const updateInternalUserSettings = async (accessToken: string, settings:
62526252
};
62536253

62546254
export const fetchOpenAPIRegistry = async (accessToken: string) => {
6255-
const url = proxyBaseUrl
6256-
? `${proxyBaseUrl}/v1/mcp/openapi-registry`
6257-
: `/v1/mcp/openapi-registry`;
6255+
try {
6256+
const url = proxyBaseUrl
6257+
? `${proxyBaseUrl}/v1/mcp/openapi-registry`
6258+
: `/v1/mcp/openapi-registry`;
62586259

6259-
const response = await fetch(url, {
6260-
method: HTTP_REQUEST.GET,
6261-
headers: {
6262-
[globalLitellmHeaderName]: `Bearer ${accessToken}`,
6263-
"Content-Type": "application/json",
6264-
},
6265-
});
6260+
const response = await fetch(url, {
6261+
method: HTTP_REQUEST.GET,
6262+
headers: {
6263+
[globalLitellmHeaderName]: `Bearer ${accessToken}`,
6264+
"Content-Type": "application/json",
6265+
},
6266+
});
62666267

6267-
if (!response.ok) {
6268-
const errorData = await response.json();
6269-
throw new Error(deriveErrorMessage(errorData));
6270-
}
6268+
if (!response.ok) {
6269+
const errorData = await response.json();
6270+
throw new Error(deriveErrorMessage(errorData));
6271+
}
62716272

6272-
return await response.json();
6273+
return await response.json();
6274+
} catch (error) {
6275+
console.error("Failed to fetch OpenAPI registry:", error);
6276+
throw error;
6277+
}
62736278
};
62746279

62756280
export const fetchDiscoverableMCPServers = async (accessToken: string) => {

0 commit comments

Comments
 (0)