get_artifact_info
Retrieve detailed artifact set information from Wuthering Waves in Markdown format. Enter the Chinese name of an artifact set to get comprehensive details about its properties and effects.
Instructions
获取库街区上的声骸详细信息并以 Markdown 格式返回。
Args:
artifact_name: 要查询的声骸套装的中文名称。
Returns:
包含声骸信息的 Markdown 字符串,
或者在找不到声骸或获取数据失败时返回错误消息。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| artifact_name | Yes |
Implementation Reference
- src/wuwa_mcp_server/server.py:44-63 (registration)Primary registration of the 'get_artifact_info' tool using @mcp.tool() decorator in FastMCP server, includes thin wrapper handler that delegates to ArtifactService.@mcp.tool() async def get_artifact_info(artifact_name: str) -> str: """获取库街区上的声骸详细信息并以 Markdown 格式返回。 Args: artifact_name: 要查询的声骸套装的中文名称。 Returns: 包含声骸信息的 Markdown 字符串, 或者在找不到声骸或获取数据失败时返回错误消息。 """ try: _, artifact_service = get_services() return await artifact_service.get_artifact_info(artifact_name) except (DataNotFoundException, ServiceException) as e: # These exceptions already have user-friendly messages return str(e) except Exception: return f"错误:处理 '{artifact_name}' 时发生意外错误。请检查服务器日志。"
- Core implementation of get_artifact_info in ArtifactService: fetches raw data from repository, parses content, generates Markdown, handles exceptions with user-friendly messages.async def get_artifact_info(self, artifact_name: str) -> str: """Get comprehensive artifact information. Args: artifact_name: Name of the artifact set to query. Returns: Markdown formatted artifact information. Raises: ServiceException: If artifact retrieval fails. """ try: self.logger.info(f"Getting artifact info for: {artifact_name}") # Get artifact raw data artifact_raw_data = await self._get_artifact_data(artifact_name) # Parse artifact content artifact_parsed_data = await asyncio.to_thread( self.content_parser.parse_artifact_content, artifact_raw_data ) # Generate markdown artifact_markdown = self.markdown_service.generate_artifact_markdown(artifact_parsed_data) if not artifact_markdown.strip(): self.logger.warning(f"Generated empty artifact info for: {artifact_name}") return f"成功获取 '{artifact_name}' 的声骸数据,但解析后的内容无法生成有效的 Markdown。" self.logger.info(f"Successfully generated artifact info for: {artifact_name}") return artifact_markdown except DataNotFoundException: error_msg = f"Artifact set '{artifact_name}' not found" self.logger.error(error_msg) return f"错误:未找到名为 '{artifact_name}' 的声骸套装。" except Exception as e: self.logger.error(f"Failed to get artifact info for {artifact_name}: {e}") raise ServiceException(f"Artifact info retrieval failed: {e}")
- Type protocol/interface defining the signature of get_artifact_info method for ArtifactService.class ArtifactServiceProtocol(ServiceProtocol): """Protocol for artifact service.""" async def get_artifact_info(self, artifact_name: str) -> str: """Get artifact information.""" ...
- src/wuwa_mcp_server/server.py:187-188 (registration)Fallback registration/dispatch logic for get_artifact_info tool call in HTTP transport mode endpoint.elif tool_name == "get_artifact_info": result = await artifact_service.get_artifact_info(arguments.get("artifact_name"))