Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Soundcite 2.0.8 Minor update available for module soundcite (2.0.8). Release: Drupal Website Security 12.0.2 Minor update available for module websecurity (12.0.2). Release: DonorPerfect 1.0.20 Minor update available for module donorperfect (1.0.20). Release: Bootstrap Cloud 7.1.5 Minor update available for theme bootstrap_cloud (7.1.5). Release: Varbase Project 11.0.9 Minor update available for module varbase_project (11.0.9). Release: Webships Starter 2.0.1 Minor update available for module webships_starter (2.0.1). Release: WebAPI Starter 2.0.1 Minor update available for module webapi_starter (2.0.1). Release: Webships Project Template 1.0.0 Initial release available for module webships_project (1.0.0)! Module Revived: Flag for Someone Else 1.0.2 Module flag_fse updated after 9 months of inactivity (1.0.2). Security Coverage: smart 404 Module smart_404 now has official Drupal security advisory coverage.

AI Agents Views

No security coverage

Part of the AI ecosystem · 308 projects

View on drupal.org

This module allows AI agents to create, list, and update Drupal Views. It provides AI tools for common Views operations like adding fields, filters, and displays, enabling agents to manage views based on natural language requests.

Let an AI Agent list, create, and update Drupal Views on your behalf.

Project Overview

AI Agents provides configured agents (a system prompt, a set of tools, a chosen provider/model) that can reason and act through a tool-calling loop. Until now, an agent had no way to work with the Views system: creating a listing, adding a field or filter, or adjusting a display all required a site builder to do it by hand in the Views UI.

AI Agents Views closes that gap with a set of AI function-call tools for common Views operations, plus a ready-to-use Views Agent that composes them: list existing views, create a new view, add a display, add or remove handlers (fields, filters, sorts, arguments, relationships), update handler options, and update display-level plugin settings (title, path, access, style, row, and more).

This project is the implementation delivered for [META] Drupal AI Views Agent, the meta issue proposing AI-driven Views configuration across the Drupal AI ecosystem. The Views Agent itself was developed in Add views agent, a child issue of that meta issue.

Note: this module is experimental. Review any view it produces before relying on it in production.

Core Functionality

  • List views: enumerate existing views, or show the full config for one.
  • Create a view: a new View entity for a given entity type, with sensible defaults.
  • Create a display: add a display (e.g. page, block) to an existing view.
  • Create a handler: add a field, filter, sort, argument, relationship, header, footer, or empty-text handler to a display.
  • Update handler options: reconfigure an existing handler (e.g. a filter's operator/value, a sort's order).
  • Remove a handler: take a handler back off a display.
  • Update display plugins: set display-level options such as title, path, access, pager, style, and row.
  • List a sample view: show core's own frontpage (public) or content (admin) view as a worked example. Available as a tool for any agent to use, though not part of the shipped Views Agent's own tool set; its system prompt gives worked config examples directly instead.
  • A shipped Views Agent config entity composes the view, display, and handler tools above into one ready-to-use agent, with a system prompt covering key Views concepts, worked config examples for common display options, and guardrails (e.g. it will not delete a view or change an existing view's base table).

Example use case

A site builder asks the Views Agent: Create an admin listing of all content, showing title, type, and status, sortable by last updated, gated behind the content overview permission. The agent creates the view, adds the display, adds the three fields and a sort, sets the access permission, and reports back what it built, all through the same tools a developer would otherwise call by hand, or via the Views UI.

Requirements

  • Drupal core ^10.3 || ^11
  • AI Agents (ai_agents)
  • Views UI (views_ui, Drupal core), required for the administer views permission the tools check against

Installation

Install as you would normally install a contributed Drupal module:

composer require 'drupal/ai_agents_views-ai_agents_views'
drush en ai_agents_views

Enabling the module installs the shipped Views Agent config entity automatically.

Usage

  1. Grant the acting user (or the agent's configured account) the administer views permission.
  2. Invoke the Views Agent through the AI Agents system (chat, or any integration that can call a configured agent) with a natural-language request.
  3. The agent plans and calls the tools it needs (creating the view, adding the display, fields, filters, and sorts) and reports the result.
  4. Review the resulting view in the Views UI as you would any other.

Sample prompt

Create an entity type node listing view with the default display, title field with label Title, sort in descending order by created date, filter by published status 1, and filter by type article. Grant 'access content' permission. Create a page display with URL 'content-listing'.

The individual tools are also available to any other agent: add them to a custom agent's tool list to compose your own Views-editing behavior.

Views Agent development assistant (submodule)

An optional submodule, views_agent_dev_assistant, adds a ready-to-use chat interface for the Views Agent: an orchestrator agent that also reaches the Content Type, Field, and Taxonomy agents, wrapped in an AI Assistant, with a chatbot block placed in the Gin toolbar so a site builder can describe what they want in plain English instead of calling tools directly.

Enabling it is one command:

drush en views_agent_dev_assistant

Its module dependencies (ai_assistant_api, ai_chatbot, gin_toolbar, block) install automatically. The Gin admin theme is the one prerequisite it cannot install for you, since a module's dependencies can only list other modules, not themes: install it first at /admin/appearance, or with drush theme:install gin. If Gin is installed after this submodule is enabled instead, its chatbot block is created automatically as soon as Gin is available, with no reinstall needed.

Demo & further reading

Similar Projects

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Aug 2026
Latest release
2 weeks ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0-beta2 Pre-release 10–11 Aug 30, 2026
1.0.0-beta1 Pre-release 10–11 Aug 6, 2026
1.0.x-dev Dev 10–11 Aug 6, 2026