Skip to main content
Glama

magento_find_table_usage

Find all code references to a database table across db_schema.xml, setup scripts, raw SQL, and resource models. Builds a cross-module dependency map to analyze the impact of schema changes.

Instructions

Find all code that references a database table — across db_schema.xml, Setup scripts (InstallSchema/UpgradeSchema), raw SQL (Zend_Db_Expr, $connection->query), getTable() calls, and resource model definitions. Builds a cross-module dependency map showing who reads/writes/creates a given table. Essential for impact analysis of schema changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYesDatabase table name to find all references for. Examples: "salesrule_ordered", "catalog_product_entity", "quote_item"
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the types of code searched and the output format (dependency map). It does not mention whether the tool is read-only or any destructive side effects, but the description implies a read-only analysis. The lack of explicit read-only statement prevents a score of 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?

The description is concise, using two sentences plus parameter description. It front-loads the purpose and lists specific code types efficiently. It could be slightly tighter, but there is no excessive verbosity.

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 tool's complexity (scanning multiple Magento code artifacts), the description covers the input (table name) and output (dependency map) well. No output schema exists, but the description hints at the return format. Without annotations, this is reasonably complete, though it could mention prerequisites like having a Magento codebase indexed.

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?

The input schema provides a description for the single parameter tableName, achieving 100% schema coverage. The tool description adds example values (e.g., 'salesrule_ordered'), which are helpful but not essential. Since schema already covers the parameter meaning, the description adds marginal value, warranting a baseline score of 3.

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 clearly states the tool's purpose: 'Find all code that references a database table' and specifies the exact types of code scanned (db_schema.xml, Setup scripts, raw SQL, etc.). It also explains the outcome: 'Builds a cross-module dependency map showing who reads/writes/creates a given table.' This distinguishes it from sibling tools like magento_find_db_schema, which focuses on schema definitions.

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?

The description says 'Essential for impact analysis of schema changes,' which implies usage context but does not explicitly say when to use this tool versus alternatives such as magento_find_db_schema or magento_trace_dependency. No exclusion criteria or when-not-to-use guidance is provided.

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/krejcif/magector'

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