Skip to main content
Glama
zeluizr

Adobe Commerce MCP

Add a table to db_schema.xml

add-db-schema
Read-onlyIdempotent

Generates an Adobe Commerce etc/db_schema.xml table definition with columns, keys, indexes, and whitelist/setup:upgrade steps, then returns the file for the caller to write.

Instructions

Generate a declarative schema etc/db_schema.xml table with columns, primary key, unique constraints, foreign keys and indexes, adapted from the official declarative schema docs, plus the whitelist and setup:upgrade steps. Returns the file for the caller to write.

Input Schema

NameRequiredDescriptionDefault
tableYesTable name (e.g. "acme_review")
engineNoSQL engine, default "innodb"
moduleYesModule name as Vendor_Module (e.g. "Acme_Reviews"), as registered in registration.php
uniqueNoUnique constraints, each a list of columns
columnsNoColumns. Without columns the table gets an entity_id int unsigned identity primary key.
commentNoTable comment
indexesNo
basePathNoModule directory relative to the Commerce root (default "app/code/<Vendor>/<Module>")
resourceNoDatabase resource (shard), default "default"
primaryKeyNoPrimary key columns (default: the identity column)
foreignKeysNo

Output Schema

NameRequiredDescriptionDefault
filesYesFiles to write. The server never writes to disk.
notesYesNext steps and caveats

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true and idempotentHint=true; the description reinforces this by stating 'Returns the file for the caller to write', which tells the agent the tool does not touch the filesystem itself — a genuinely useful clarification. It also mentions the whitelist and setup:upgrade follow-up steps, adding procedural context. It stops short of saying whether an existing table definition would be overwritten, which is why it is not a 5.

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

Conciseness4/5

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

A single dense sentence front-loads the verb and the artifact, with the return-value caveat appended last. Every clause carries information, though 'declarative schema etc/db_schema.xml table' reads slightly awkwardly.

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

Completeness5/5

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

With 11 parameters at 82% coverage, full annotation coverage, and an output schema, the description only needs to establish intent and the non-writing contract — both of which it does. Nothing an agent needs to invoke the tool correctly is missing, aside from optional context on existing-table handling.

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 82%, so the parameters are already well documented in the input schema. The description enumerates the element groups (columns, primaryKey, unique, foreignKeys, indexes), which mirrors the schema rather than adding semantics such as merge behavior or validation rules for these structures. Baseline 3 is appropriate.

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?

States a specific verb (Generate) and a very specific resource (etc/db_schema.xml table) with the exact contents enumerated: columns, primary key, unique constraints, foreign keys, indexes. It is clearly distinguishable from siblings such as add-plugin or add-observer by the artifact alone, though it never names a sibling explicitly.

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 only implied — an agent can infer this is for adding a table to a Magento module, and the phrase 'adapted from the official declarative schema docs' hints at the authority behind the output. There is no explicit when-to-use, no conditions under which it should not be used (e.g. altering an existing table), and no named alternative.

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