Skip to content

Improve apis for cli#13

Merged
herber merged 4 commits into
mainfrom
improve-apis-for-cli
Apr 3, 2026
Merged

Improve apis for cli#13
herber merged 4 commits into
mainfrom
improve-apis-for-cli

Conversation

@herber
Copy link
Copy Markdown
Member

@herber herber commented Apr 3, 2026

Note

Medium Risk
Medium risk because this is a regenerated client surface that changes method signatures and response model shapes (e.g., renamed fields and list item typing), which can break downstream CLI/client code at runtime or type-check time.

Overview
Adds new filtering and association options across generated endpoints: Magic MCP servers list now supports preconfigured_only, Magic MCP tokens list can be filtered by magic_mcp_server_id, and provider templates list adds search.

Updates Magic MCP token creation to replace group_ids with magic_mcp_group_ids and optionally bind a token to a single magic_mcp_server_id, and expands token responses to include an optional server object.

Refreshes several response models: magic MCP server objects gain source (and optional session_id in create/get/update/delete outputs), session magic MCP server embeds switch from session_template_id to source, consumer “member consumer” responses now return a structured profile (with optional groups) instead of is_portal_consumer/is_organization_member, and magic MCP servers list output now returns items as raw Dict[str, Any] rather than a typed item model.

Written by Cursor Bugbot for commit a9f0faf. This will update automatically on new commits. Configure here.

@herber herber self-assigned this Apr 3, 2026
created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None,
updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None
updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None,
profile=mapConsumersGetMemberConsumerOutputProfile.from_dict(data.get('profile')) if data.get('profile') else None
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing mapper classes cause NameError at runtime

High Severity

The from_dict methods reference mapper classes like mapConsumersGetMemberConsumerOutputProfile, mapDashboardInstanceConsumersGetMemberConsumerOutputProfile, and mapManagementInstanceConsumersGetMemberConsumerOutputProfile, but none of these classes are defined anywhere in the codebase. New dataclasses for the profile types were generated, but the corresponding mapper classes were not. This causes a NameError at runtime whenever a response includes a profile field. Affects all six get_member_consumer.py files across both API versions.

Additional Locations (2)
Fix in Cursor Fix in Web

updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None,
is_portal_consumer=data.get('is_portal_consumer'),
is_organization_member=data.get('is_organization_member')
profile=mapConsumersGetMemberConsumerOutputProfile.from_dict(data.get('profile')) if data.get('profile') else None
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing mapper classes cause NameError for profile deserialization

High Severity

The from_dict methods reference mapper classes like mapConsumersGetMemberConsumerOutputProfile, mapDashboardInstanceConsumersGetMemberConsumerOutputProfile, and mapManagementInstanceConsumersGetMemberConsumerOutputProfile that are never defined anywhere in the codebase. The dataclass definitions (e.g., ConsumersGetMemberConsumerOutputProfile) were generated, but the corresponding map* classes with from_dict/to_dict static methods were not. This causes a NameError at runtime whenever the API response includes a non-null profile field. Affects all six get_member_consumer.py files across both API versions.

Additional Locations (2)
Fix in Cursor Fix in Web


@staticmethod
def to_dict(value: Union[DashboardInstanceMagicMcpServersCreateOutputEndpoints, Dict[str, Any], None]) -> Optional[Dict[str, Any]]:
if value is None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted mapper classes still referenced in from_dict methods

High Severity

The mapXxxOutputEndpoints mapper classes were deleted from all magic MCP server CRUD files (create, get, delete, update) in the mt_2025_01_01_dashboard version, but the from_dict methods still call them (e.g. mapDashboardInstanceMagicMcpServersCreateOutputEndpoints.from_dict(item)). Grep confirms these classes no longer exist anywhere in the mt_2025_01_01_dashboard tree, causing a NameError at runtime for every create/get/delete/update operation on magic MCP servers. This affects all three namespaces (dashboard, magic_mcp_servers, management) — 12 files total.

Additional Locations (2)
Fix in Cursor Fix in Web

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 4 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


@staticmethod
def to_dict(value: Union[MagicMcpServersCreateOutputEndpoints, Dict[str, Any], None]) -> Optional[Dict[str, Any]]:
if value is None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted endpoints mapper class still referenced in from_dict

High Severity

The mapXxxEndpoints mapper classes (e.g. mapMagicMcpServersCreateOutputEndpoints) were deleted from the magic MCP servers create.py, delete.py, get.py, and update.py files across all three namespaces (12 files total), but the from_dict methods still reference them via mapXxxEndpoints.from_dict(item). Since the classes no longer exist in these files and aren't imported, any call to from_dict will raise a NameError at runtime.

Additional Locations (2)
Fix in Cursor Fix in Web

@herber herber merged commit a9f0faf into main Apr 3, 2026
9 checks passed
@herber herber deleted the improve-apis-for-cli branch April 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant