ai_tool_screenshot
AI Tool Screenshot enables AI agents to capture and visually analyse rendered Drupal pages by taking a full-page browser screenshot on demand. It bridges the gap between what an AI agent can read in source code and what a human actually sees in the browser — making tasks like visual accessibility auditing, UI review, and screenshot-based reporting possible without any external headless browser service.
When an AI agent calls the get_page_screenshot tool, the user's own browser silently captures the page using the bundled html2canvas library and uploads the image as a managed Drupal file. The agent receives the file ID and can immediately pass it to a vision-capable model for analysis.
When would you use this module?
No configuration page is required. After enabling the module:
The module automatically attaches its polling JavaScript to every authenticated-user page load. When the agent initiates a capture request, the browser detects it within one second and silently takes the screenshot in the background. The captured image is saved to public://ai-screenshots/ as a permanent managed file, and the agent receives the file ID to use with downstream tools.
Tool parameters available to agents:
The html2canvas JavaScript library (v1.4.1, MIT license) is bundled inside the module at js/html2canvas.min.js — no separate download is needed.
Feature requests, bug reports, and patches are welcome via the issue queue on this project page.
See the README.md bundled with the module for installation, configuration, and usage details including tool parameter reference and known html2canvas limitations.