[{'Text': '"""Chart generation and access tools."""\n\nfrom typing import Optional\nfrom mcp.server.fastmcp import Context\nfrom mcp.server.session import ServerSession\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\n# Public chart tools (no credentials needed) - always available\ndef get_point_topic_public_chart_catalog(ctx: Optional[Context[ServerSession, None]] = None) -> str:\n    """Get all available public charts from the Point Topic Charts API.\n\n    Fetches the public chart catalog (no authentication required).\n\n    Returns:\n        JSON string containing public chart catalog with titles, parameters, and example URLs.\n    """\n    import requests\n    import json\n    response = requests.get("https://charts.point-topic.com/public")\n    return json.dumps(response.json())\n\n\ndef get_point_topic_public_chart_csv(url: str, ctx: Optional[Context[ServerSession, None]] = None) -> str:\n    """Get a specific public chart from Point Topic Charts API as CSV.\n\n    Use this to fetch chart data for context when displaying charts.\n    For iframe embedding, use URL without format parameter.\n\n    Args:\n        url: Chart URL WITHOUT the format parameter (e.g., no &format=png/csv).\n\n    Returns: CSV string with chart data\n    """\n    import urllib.parse\n    import requests\n\n    # strip any existing format param and add format=csv\n    parsed = urllib.parse.urlparse(url)\n    query = urllib.parse.parse_qs(parsed.query)\n    query.pop(\'format\', None)\n    query[\'format\'] = [\'csv\']\n    csv_url = urllib.parse.urlunparse(parsed._replace(query=urllib.parse.urlencode(query, doseq=True)))\n\n    resp = requests.get(csv_url)\n    if resp.status_code != 200:\n        return f"Error: {resp.status_code} {resp.text}"\n\n    return resp.text\n'}]