Skip to main content
Glama

ddev_exec

Execute shell commands inside DDEV project services (web, db, redis, solr) for testing, dependency management, and database inspection.

Instructions

Execute a shell command in the container for a DDEV service. Default: web service; use service (e.g. db, redis, solr) to run in another. workdir maps to ddev --dir. Usage: ddev exec [flags] [command] [command-flags] Flags: -s/--service (default web), -d/--dir (execution directory) For full options: ddev help exec

COMMON USE CASES:

Drupal (Drush):

  • "drush status" - Site status

  • "drush cr" - Clear cache

  • "drush uli" - Generate login link

  • "drush cex" - Export config

  • "drush cim" - Import config

  • "drush pm:install module_name" - Install module

  • "drush updb -y" - Run database updates

WordPress (WP-CLI):

  • "wp cli version" - WP-CLI version

  • "wp plugin list" - List plugins

  • "wp plugin install akismet --activate" - Install & activate plugin

  • "wp theme list" - List themes

  • "wp user list" - List users

  • "wp core update" - Update WordPress

  • "wp cache flush" - Clear cache

  • "wp search-replace old.com new.com" - Search/replace URLs

Composer:

  • "composer install" - Install dependencies

  • "composer update" - Update packages

  • "composer require vendor/package" - Add package

  • "composer show" - List installed packages

Redis:

  • "redis-cli INFO" - Server info

  • "redis-cli PING" - Test connection

  • "redis-cli KEYS *" - List keys

  • "redis-cli FLUSHALL" - Clear all caches

Solr:

MySQL/MariaDB:

  • "mysql -e 'SHOW DATABASES'" - List databases

  • "mysql -e 'SHOW TABLES' db" - List tables

  • "mysql -e 'SELECT VERSION()'" - Database version

Platform.sh CLI:

  • "platform environment:list" - List environments

  • "platform db:dump" - Export database

Node.js/npm:

  • "npm install" - Install packages

  • "npm run build" - Build assets

  • "npm run test" - Run tests

  • "node --version" - Node version

Testing Frameworks:

  • "playwright test" - Run Playwright tests

  • "cypress run" - Run Cypress tests

  • "phpunit" - Run PHP unit tests

Other:

  • "php -v" - PHP version

  • "ls -la" - List files

  • "cat config/sync/system.site.yml" - Read file

  • "env" - Show environment variables

Dangerous commands blocked unless ALLOW_DANGEROUS_COMMANDS=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesCommand to execute. Examples: "playwright test" (run Playwright tests), "npm run test:e2e" (run E2E tests), "npm run build" (build assets), "redis-cli ping" (test Redis), "curl http://solr:8983/solr/" (test Solr). For Drush commands, use ddev_drush. For Composer commands, use ddev_composer. Dangerous commands are blocked unless ALLOW_DANGEROUS_COMMANDS=true.
serviceNoService to execute in: web (default), db, redis, solr, or any other service. AUTO-ROUTING: npm/php commands → web, mysql/mariadb commands → db, redis-cli commands → redis, solr commands → solr
workdirNoWorking directory for the command (e.g., "/var/www/html", "/var/www/html/drupal")
projectPathYesPath to the DDEV project directory
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses a key safety behavior: 'Dangerous commands blocked unless ALLOW_DANGEROUS_COMMANDS=true.' It also mentions default service and workdir mapping. However, it does not describe output format, exit code handling, or whether commands are executed via a shell, leaving notable behavioral gaps for an execution tool.

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 description is front-loaded with a clear purpose statement, but the extensive list of common use cases across many frameworks makes it long. While well-organized with headers and bullets, it could be more concise; many examples are redundant for an AI agent that can infer typical commands.

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

Completeness4/5

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

Given the absence of output schema and annotations, the description compensates with comprehensive examples, service routing details, and safety disclaimers. It covers all necessary aspects for correct invocation, but lacks information about return values, timeouts, or prerequisites (e.g., project must be running), leaving minor completeness gaps.

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

Parameters4/5

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

Schema description coverage is 100%, setting a baseline of 3. The description adds value beyond the schema by providing a detailed 'Common Use Cases' section with concrete command examples and by explaining that 'workdir maps to ddev --dir' and the default service, enriching parameter understanding.

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?

The description opens with 'Execute a shell command in the container for a DDEV service,' clearly stating the verb (execute), resource (shell command in DDEV container), and scope. It distinguishes itself from sibling tools like ddev_logs and ddev_export_db by emphasizing generic command execution and service selection.

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

Usage Guidelines5/5

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

The schema's command description explicitly says 'For Drush commands, use ddev_drush. For Composer commands, use ddev_composer,' providing clear alternatives. The service description also explains auto-routing (e.g., npm/php commands → web, mysql → db), giving concrete when-to-use guidance. The main description adds default service and workdir mapping.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/codingsasi/ddev-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server