skydeckai-code 0.1.26__py3-none-any.whl → 0.1.27__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aidd/tools/web_tools.py CHANGED
@@ -48,6 +48,12 @@ def web_fetch_tool():
48
48
  "will be saved to this location. Must be within the allowed directory. Example: "
49
49
  "'downloads/page.html', 'data/api_response.json'.",
50
50
  "default": None
51
+ },
52
+ "convert_html_to_markdown": {
53
+ "type": "boolean",
54
+ "description": "If set to true and the content is HTML, it will be converted to markdown format "
55
+ "for better readability. This is especially useful for web pages with a lot of content.",
56
+ "default": True
51
57
  }
52
58
  },
53
59
  "required": ["url"]
@@ -61,6 +67,7 @@ async def handle_web_fetch(arguments: dict) -> List[TextContent]:
61
67
  headers = arguments.get("headers", {})
62
68
  timeout = arguments.get("timeout", 10)
63
69
  save_to_file = arguments.get("save_to_file")
70
+ convert_html_to_markdown = arguments.get("convert_html_to_markdown", True)
64
71
 
65
72
  if not url:
66
73
  raise ValueError("URL must be provided")
@@ -123,6 +130,23 @@ async def handle_web_fetch(arguments: dict) -> List[TextContent]:
123
130
  # Try to decode the content
124
131
  try:
125
132
  text_content = content.decode('utf-8')
133
+
134
+ # Convert HTML to markdown if requested and content appears to be HTML
135
+ if convert_html_to_markdown and ("html" in content_type or text_content.strip().startswith(("<!DOCTYPE", "<html"))):
136
+ try:
137
+ # Using the html2text library to convert HTML to markdown
138
+ # Need to import here to avoid dependency issues if the library is not installed
139
+ import html2text
140
+ h = html2text.HTML2Text()
141
+ h.ignore_links = False
142
+ h.ignore_images = False
143
+ h.ignore_emphasis = False
144
+ h.body_width = 0 # Don't wrap text
145
+ text_content = h.handle(text_content)
146
+ except ImportError:
147
+ # Add note that html2text needs to be installed
148
+ text_content = f"NOTE: Could not convert HTML to markdown because html2text library is not installed.\n\n{text_content}"
149
+
126
150
  except UnicodeDecodeError:
127
151
  # If content can't be decoded as utf-8, provide info about binary content
128
152
  if full_save_path:
@@ -140,10 +164,11 @@ async def handle_web_fetch(arguments: dict) -> List[TextContent]:
140
164
  status_info = f"HTTP {response.status_code}"
141
165
  size_info = f"{len(content)} bytes"
142
166
  save_info = f", saved to {save_to_file}" if full_save_path else ""
167
+ format_info = " (converted to markdown)" if convert_html_to_markdown and ("html" in content_type or text_content.strip().startswith(("<!DOCTYPE", "<html"))) else ""
143
168
 
144
169
  result = [TextContent(
145
170
  type="text",
146
- text=f"{status_info}, {size_info}{save_info}:\n\n{text_content}"
171
+ text=f"{status_info}, {size_info}{save_info}{format_info}:\n\n{text_content}"
147
172
  )]
148
173
 
149
174
  return result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skydeckai-code
3
- Version: 0.1.26
3
+ Version: 0.1.27
4
4
  Summary: This MCP server provides a comprehensive set of tools for AI-driven Development workflows including file operations, code analysis, multi-language execution, Git operations, web content fetching, code content searching, and system information retrieval.
5
5
  Project-URL: Homepage, https://github.com/skydeckai/skydeckai-code
6
6
  Project-URL: Repository, https://github.com/skydeckai/skydeckai-code
@@ -11,6 +11,7 @@ License-File: LICENSE
11
11
  Keywords: ai,aidd,code,code-analysis,development,mcp
12
12
  Requires-Python: >=3.11
13
13
  Requires-Dist: gitpython>=3.1.44
14
+ Requires-Dist: html2text>=2025.4.15
14
15
  Requires-Dist: mcp>=1.6.0
15
16
  Requires-Dist: mss>=10.0.0
16
17
  Requires-Dist: pillow>=11.1.0
@@ -529,7 +530,8 @@ Fetches content from a URL and optionally saves it to a file.
529
530
  "Accept": "application/json"
530
531
  },
531
532
  "timeout": 15,
532
- "save_to_file": "downloads/octocat.json"
533
+ "save_to_file": "downloads/octocat.json",
534
+ "convert_html_to_markdown": true
533
535
  }
534
536
  ```
535
537
 
@@ -540,9 +542,10 @@ Fetches content from a URL and optionally saves it to a file.
540
542
  | headers | object | No | Optional HTTP headers to include in the request |
541
543
  | timeout | integer | No | Maximum time to wait for response (default: 10s) |
542
544
  | save_to_file | string | No | Path to save response content (within allowed directory) |
545
+ | convert_html_to_markdown | boolean | No | When true, converts HTML content to markdown for better readability (default: true) |
543
546
 
544
547
  **Returns:**
545
- Response content as text with HTTP status code and size information. For binary content, returns metadata and saves to file if requested.
548
+ Response content as text with HTTP status code and size information. For binary content, returns metadata and saves to file if requested. When convert_html_to_markdown is enabled, HTML content is automatically converted to markdown format for better readability.
546
549
 
547
550
  This tool can be used to access web APIs, fetch documentation, or download content from the web while respecting size limits (10MB max) and security constraints.
548
551
 
@@ -560,6 +563,12 @@ skydeckai-code-cli --tool web_fetch --args '{
560
563
  "url": "https://github.com/github/github-mcp-server/blob/main/README.md",
561
564
  "save_to_file": "downloads/readme.md"
562
565
  }'
566
+
567
+ # Fetch a webpage and convert to markdown for better readability
568
+ skydeckai-code-cli --tool web_fetch --args '{
569
+ "url": "https://example.com",
570
+ "convert_html_to_markdown": true
571
+ }'
563
572
  ```
564
573
 
565
574
  ### Utility Tools
@@ -17,9 +17,9 @@ aidd/tools/path_tools.py,sha256=RGoOhqP69eHJzM8tEgn_5-GRaR0gp25fd0XZIJ_RnQE,4045
17
17
  aidd/tools/screenshot_tool.py,sha256=NMO5B4UG8qfMEOMRd2YoOjtwz_oQ2y1UAGU22jV1yGU,46337
18
18
  aidd/tools/state.py,sha256=RWSw0Jfsui8FqC0xsI7Ik07tAg35hRwLHa5xGBVbiI4,1493
19
19
  aidd/tools/system_tools.py,sha256=H4_qveKC2HA7SIbi-j4vxA0W4jYh2wfu9A6ni5wkZyA,7249
20
- aidd/tools/web_tools.py,sha256=VlxjWrd6Vtzxv8wbwC8zoocWK7CUM-K_x0JTdH1TpKk,6925
21
- skydeckai_code-0.1.26.dist-info/METADATA,sha256=yK33eoC1ocqQziUNPq9u2_5aHUPwEJI6srZay-iAvBk,28662
22
- skydeckai_code-0.1.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- skydeckai_code-0.1.26.dist-info/entry_points.txt,sha256=cT-IHh3_ioGLk3kwIeqj1X6Li1dnJinX9qKWUl7nOLg,80
24
- skydeckai_code-0.1.26.dist-info/licenses/LICENSE,sha256=uHse04vmI6ZjW7TblegFl30X-sDyyF0-QvH8ItPca3c,10865
25
- skydeckai_code-0.1.26.dist-info/RECORD,,
20
+ aidd/tools/web_tools.py,sha256=DEovG7ZK2ER0S8YY0He5AsAfYMDpwLeqENEbuOhuEpY,8562
21
+ skydeckai_code-0.1.27.dist-info/METADATA,sha256=-_y9BgFYwFNJmIgUUmoLAJkaOiBQvC8paZiGhhwV3ZA,29177
22
+ skydeckai_code-0.1.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ skydeckai_code-0.1.27.dist-info/entry_points.txt,sha256=cT-IHh3_ioGLk3kwIeqj1X6Li1dnJinX9qKWUl7nOLg,80
24
+ skydeckai_code-0.1.27.dist-info/licenses/LICENSE,sha256=uHse04vmI6ZjW7TblegFl30X-sDyyF0-QvH8ItPca3c,10865
25
+ skydeckai_code-0.1.27.dist-info/RECORD,,