{"record":{"id":"cbac8bd7ebd87c21","repo":"ComposioHQ/composio","slug":"failed-to-update-mcp-server-server-id","errorCode":null,"errorMessage":"Failed to update MCP server {server_id}","messagePattern":"Failed to update MCP server (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"python/composio/core/models/mcp.py","lineNumber":411,"sourceCode":"\n                update_params[\"toolkits\"] = toolkit_names\n                update_params[\"auth_config_ids\"] = auth_config_ids\n\n            if allowed_tools is not None:\n                update_params[\"custom_tools\"] = allowed_tools\n\n            if manually_manage_connections is not None:\n                update_params[\n                    \"managed_auth_via_composio\"\n                ] = not manually_manage_connections\n\n            # Use the MCP update endpoint\n            response = self._client.mcp.update(server_id, **update_params)\n\n            return response\n\n        except Exception as e:\n            raise ValidationError(f\"Failed to update MCP server {server_id}\") from e\n\n    def delete(self, server_id: str) -> t.Dict[str, t.Any]:\n        \"\"\"\n        Permanently delete an MCP server configuration.\n\n        :param server_id: The unique identifier of the MCP server to delete\n        :return: Deletion result\n\n        Example:\n            >>> # Delete a server\n            >>> result = composio.experimental.mcp.delete('mcp_12345')\n            >>>\n            >>> if result['deleted']:\n            ...     print(f\"Server {result['id']} has been successfully deleted\")\n            >>> else:\n            ...     print(f\"Failed to delete server {result['id']}\")\n        \"\"\"\n        try:","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/core/models/mcp.py#L393-L429","documentation":"Raised when MCP.update(server_id, ...) fails to apply updates through client.mcp.update — any exception during the PATCH/PUT call (invalid params, bad ID, backend error) is wrapped into this ValidationError with the server_id in the message.","triggerScenarios":"Calling composio.mcp.update() with a nonexistent server_id, an empty/invalid update payload, or when the generated client rejects the keyword arguments passed as update_params.","commonSituations":"Passing toolkit names that don't exist, renaming to a duplicate name, SDK version drift where update() signature changed, stale server_id.","solutions":["Check e.__cause__ for the exact backend error","Confirm the server still exists via composio.mcp.get(server_id) before updating","Validate toolkit slugs in the toolkits argument against composio.toolkits.list()","Upgrade composio to match the current backend API"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if composio.mcp.get(server_id) is None:\n    raise ValueError('server missing')","typeGuard":null,"tryCatchPattern":"try:\n    composio.mcp.update(server_id, name=new_name)\nexcept ValidationError as e:\n    logger.error('update failed: %s', e.__cause__)\n    raise","preventionTips":["Validate toolkit slugs first","Read-modify-write with fresh get()"],"tags":["mcp","python","update","api-error"],"backgroundTag":"api-request-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}