Skip to content

Commit 87f4f87

Browse files
committed
fix: update env_schema type from str to dict in McpServerDetail and related tools
1 parent c6b6365 commit 87f4f87

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/modelscope_mcp_server/tools/mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async def get_mcp_server_detail(
135135
# Additional fields
136136
author=server_data.get("author", ""),
137137
server_config=server_data.get("server_config", []),
138-
env_schema=server_data.get("env_schema", ""),
138+
env_schema=server_data.get("env_schema", {}),
139139
is_hosted=server_data.get("is_hosted", False),
140140
is_verified=server_data.get("is_verified", False),
141141
source_url=server_data.get("source_url", ""),

src/modelscope_mcp_server/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class McpServerDetail(McpServer):
159159

160160
# Configuration
161161
server_config: Annotated[list[dict], Field(description="Server configuration")] = []
162-
env_schema: Annotated[str, Field(description="JSON schema for environment variables")]
162+
env_schema: Annotated[dict, Field(description="JSON schema for environment variables")]
163163

164164
# Status flags
165165
is_hosted: Annotated[bool, Field(description="Whether the server supports hosted mode")]

tests/tools/test_get_mcp_server_detail.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def validate_server_detail_fields(server_detail):
5252

5353
for field in required_fields:
5454
assert hasattr(server_detail, field), f"Server detail should have '{field}' attribute"
55-
5655
# Validate field types
5756
assert isinstance(server_detail.id, str), "ID should be a string"
5857
assert isinstance(server_detail.name, str), "Name should be a string"
@@ -62,7 +61,6 @@ def validate_server_detail_fields(server_detail):
6261
assert isinstance(server_detail.view_count, int), "View count should be an integer"
6362
assert isinstance(server_detail.github_stars, int), "GitHub stars should be an integer"
6463
assert isinstance(server_detail.server_config, list), "Server config should be a list"
65-
assert isinstance(server_detail.env_schema, str), "Env schema should be a string"
6664
assert isinstance(server_detail.readme, str), "Readme should be a string"
6765
assert isinstance(server_detail.logo_url, str), "Logo URL should be a string"
6866

0 commit comments

Comments
 (0)