Skip to main content
Glama
run-as-root

Warden Magento MCP Server

by run-as-root

warden_db_query

Execute SQL queries in Magento databases within Warden-managed development environments to manage and retrieve data.

Instructions

Run a SQL query in the Warden database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the project directory
queryYesSQL query to execute
databaseNoDatabase name (optional, defaults to magento)magento

Implementation Reference

  • The main handler function that implements the 'warden_db_query' tool. It destructures the arguments, builds a 'warden env exec db mysql ...' command to execute the provided SQL query in the specified database (default 'magento'), and calls executeWardenCommand to run it and format the response.
    async runDbQuery(args) {
      const { project_path, query, database = "magento" } = args;
    
      const wardenCommand = [
        "env",
        "exec",
        "-T",
        "db",
        "mysql",
        "-u",
        "root",
        "-pmagento",
        database,
        "-e",
        query,
      ];
    
      return await this.executeWardenCommand(
        project_path,
        wardenCommand,
        `Running database query in ${database}`,
      );
    }
  • Input schema definition for the warden_db_query tool, specifying required project_path and query parameters, and optional database (defaults to 'magento').
    inputSchema: {
      type: "object",
      properties: {
        project_path: {
          type: "string",
          description: "Path to the project directory",
        },
        query: {
          type: "string",
          description: "SQL query to execute",
        },
        database: {
          type: "string",
          description: "Database name (optional, defaults to magento)",
          default: "magento",
        },
      },
      required: ["project_path", "query"],
    },
  • server.js:100-122 (registration)
    Tool registration entry in the ListToolsRequestSchema handler's tools array, defining the name, description, and input schema for 'warden_db_query'.
    {
      name: "warden_db_query",
      description: "Run a SQL query in the Warden database",
      inputSchema: {
        type: "object",
        properties: {
          project_path: {
            type: "string",
            description: "Path to the project directory",
          },
          query: {
            type: "string",
            description: "SQL query to execute",
          },
          database: {
            type: "string",
            description: "Database name (optional, defaults to magento)",
            default: "magento",
          },
        },
        required: ["project_path", "query"],
      },
    },
  • server.js:331-332 (registration)
    Handler dispatch registration in the CallToolRequestSchema switch statement, mapping 'warden_db_query' to the runDbQuery method.
    case "warden_db_query":
      return await this.runDbQuery(request.params.arguments);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Run a SQL query' implies execution but reveals nothing about permissions needed, whether queries are read-only or can modify data, transaction handling, error behavior, or result formatting. This leaves critical behavioral aspects undocumented.

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

Conciseness5/5

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

The description is a single, efficient sentence that communicates the core functionality without any wasted words. It's perfectly front-loaded and appropriately sized for what it does convey.

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

Completeness2/5

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

For a database query tool with no annotations and no output schema, the description is incomplete. It doesn't address critical aspects like query types supported, result format, error handling, or security considerations, leaving significant gaps for an agent to understand how to use this tool effectively.

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 description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter context beyond what's already in the structured fields, which meets the baseline expectation but doesn't provide extra value.

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

Purpose4/5

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

The description clearly states the action ('Run a SQL query') and target resource ('in the Warden database'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling database tools (though none are listed among siblings), which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or any contextual constraints. It's a bare statement of functionality with zero usage context, which is insufficient for effective tool selection.

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/run-as-root/warden-mcp-server'

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