Skip to main content
Glama

MCP-RoCQ

xml_parser.py1.38 kB
""" XML Parser for Coq responses. Handles structured communication with Coq's XML protocol. """ from typing import Dict from xml.etree import ElementTree as ET class CoqXMLParser: @staticmethod def parse_response(xml_str: str) -> Dict: """ Parse Coq's XML protocol response into structured data Args: xml_str: Raw XML response from Coq Returns: Dict containing parsed response with status and message """ try: root = ET.fromstring(xml_str) if root.tag == "value": return { "status": "success", "message": root.text, "response_type": root.get("val") } elif root.tag == "feedback": return { "status": "feedback", "message": root.find("message").text, "level": root.get("object") } elif root.tag == "error": return { "status": "error", "message": root.find("message").text } return {"status": "unknown", "message": xml_str} except ET.ParseError as e: return {"status": "error", "message": f"XML parse error: {e}"}

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/angrysky56/mcp-rocq'

If you have feedback or need assistance with the MCP directory API, please join our Discord server