Skip to main content
Glama

Views Execute

views_execute

Execute a Drupal view through the Views API and return its rows; pass display, contextual filters, exposed filters, limit, and offset to target results.

Instructions

Execute a view and return its rows.

Runs the view through the Views API rather than guessing at a GraphQL schema. The graphql module ships no view(view_id:...) root field, so the query this used to send could never resolve, and the fallback asked JSON:API for views/{id}/{display}, which is not a resource either. Neither path was reachable, so the tool failed wherever Views was installed and healthy.

args are the view's contextual filters, in order. filters are set on the view's exposed input, which is what a visitor filling in the view's own filter form sets. A display that does not exist is reported along with the displays the view does have: ViewExecutable::setDisplay would otherwise fail later, with a message naming neither the view nor the display the caller asked for.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
limitNo
offsetNo
filtersNo
view_idYes
display_idNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and delivers real behavior: it runs through the Views API, and a nonexistent display is reported along with the displays the view actually has (instead of a late, opaque setDisplay failure). It adds genuine error-handling context. It omits permission requirements, cost/performance, and read-only framing, so it is not complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead sentence is front-loaded and correct, but roughly half the text is a historical bug narrative about GraphQL/JSON:API paths that 'could never resolve.' That context explains the fix but does not help an agent decide or invoke the tool, so it consumes space without earning it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. For a six-parameter, zero-annotation tool it covers args and filters well but leaves limit/offset/display_id and permission behavior unaddressed, making it only adequate for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it explains args (contextual filters, in order) and filters (exposed-input values set by a form visitor) meaningfully beyond the bare schema. However, limit, offset, view_id, and display_id get no semantic coverage at all, leaving four of six parameters undocumented anywhere.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Execute a view and return its rows'), which is exactly what distinguishes it from siblings like views_list, views_get, and views_export. An agent can tell it executes a stored view and returns data without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated. It never says when to call this versus views_get, views_list, views_export, db_query, or graphql_query, so the agent must infer that this is the execution/read-rows path. The args/filters distinction gives partial guidance but no explicit when-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools