{"record":{"id":"3c1a8d47d463783c","repo":"microsoft/autogen","slug":"failed-to-list-mcp-resources","errorCode":null,"errorMessage":"Failed to list MCP resources","messagePattern":"Failed to list MCP resources","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-studio/frontend/src/components/views/mcp/api.ts","lineNumber":121,"sourceCode":"      gallery.config.components.workbenches?.filter(\n        (workbench): workbench is Component<McpWorkbenchConfig> =>\n          workbench.provider.includes(\"McpWorkbench\") ||\n          (workbench.config as any)?.server_params !== undefined\n      ) || []\n    );\n  }\n\n  // MCP Server operations (new functionality)\n  async listResources(serverParams: McpServerParams) {\n    const response = await fetch(`${this.getBaseUrl()}/mcp/resources/list`, {\n      method: \"POST\",\n      headers: this.getHeaders(),\n      body: JSON.stringify({ server_params: serverParams }),\n    });\n\n    const data = await response.json();\n    if (!response.ok) {\n      throw new Error(data.message || \"Failed to list MCP resources\");\n    }\n\n    return data;\n  }\n\n  async getResource(serverParams: McpServerParams, uri: string) {\n    const response = await fetch(`${this.getBaseUrl()}/mcp/resources/get`, {\n      method: \"POST\",\n      headers: this.getHeaders(),\n      body: JSON.stringify({\n        server_params: serverParams,\n        uri: uri,\n      }),\n    });\n\n    const data = await response.json();\n    if (!response.ok) {\n      throw new Error(data.message || \"Failed to get MCP resource\");","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-studio/frontend/src/components/views/mcp/api.ts#L103-L139","documentation":"Generic wrapper for any other HttpResponseError from the Azure AI Search service during client init or search (status codes other than 401/403): typical examples are 400 bad request (bad api_version, malformed query), 404 endpoint/index path, or 5xx service errors. The raw service message is embedded via str(e).","triggerScenarios":"SearchClient/search call returning an HTTP error other than 401/403 — most often a wrong `api_version` for the service (400 with 'The requested API version is invalid'), a semantically misconfigured query, or a transient 5xx.","commonSituations":"Default api_version drifting from what the service accepts as it evolves; semantic query_type without a semantic configuration on the index; preview-only features requested with a stable api_version.","solutions":["Read the embedded service message in str(e) — Azure's error text names the exact problem.","If it's an api_version complaint, set `api_version` in AzureAISearchConfig to one the service supports (check the portal or try a current stable version).","For 5xx/429 transient codes, retry with backoff; the tool does not retry on its own.","For 400s about semantic/vector options, align query_type, semantic_config_name and vector_fields with what the index actually defines."],"exampleFix":"# before\nconfig = AzureAISearchConfig(..., api_version=\"2023-07-01-Preview\")  # 400 on newer services\n\n# after\nconfig = AzureAISearchConfig(..., api_version=\"2024-07-01\")","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"import asyncio\n\nasync def run_with_retry(tool, query, attempts=3):\n    for i in range(attempts):\n        try:\n            return await tool.run(query)\n        except ValueError as e:\n            status = getattr(e.__cause__, \"status_code\", None)\n            if status and 500 <= status < 600 and i < attempts - 1:\n                await asyncio.sleep(2 ** i)\n                continue\n            raise","preventionTips":["Read the embedded service message first — it identifies api_version/parameter problems precisely.","Keep api_version pinned and reviewed when upgrading the SDK or the service."],"tags":["python","azure-ai-search","http-error","wrapper-exception"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}