Skip to main content
Glama
jigarkkarangiya

magento-sql-mcp-server

Count Table Rows

count_table_rows
Read-onlyIdempotent

Count rows in a Magento table to estimate its size safely before executing select queries, using approximate or exact methods.

Instructions

Returns approximate or exact row count for a single table. Safer than SELECT * on large Magento tables. Use before execute_select_query to gauge table size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesMagento database table name (e.g. sales_order, catalog_product_entity).
profileNoOverride the MAGENTO_SQL_PROFILE env var for this call only. Use list_connection_profiles to see available names.
magentoRootNoAbsolute path to the Magento root (must contain app/etc/env.php). Defaults to MAGENTO_ROOT env var or auto-discovery.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
rowsYes
sampledNo
rowCountYes
truncatedNo
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds nuance about approximate vs. exact counts and the safety advantage over SELECT *, which goes beyond the annotations. Yet it doesn't clarify when approximate vs. exact occurs or address rate limits or auth, which are not covered by annotations. The addition is modest.

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 three sentences with zero fluff. The primary function comes first, followed by a safety note and a concrete usage tip. Every sentence earns its place, and the structure guides the agent from what → why → when.

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?

For a simple single-required-parameter tool with an output schema present, the description covers the essential aspects: what it does, safety characteristics, and a common use case. It doesn't elaborate on return format or edge cases, but the output schema handles return details, and the description's core guidance is sufficient. A minor gap is the lack of explicit mention that the count is not guaranteed exact for InnoDB tables, but that's implied by 'approximate or exact.'

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% — all three parameters (table, profile, magentoRoot) include descriptive text in the schema. The description itself adds no parameter-level detail beyond the schema. Per the baseline, when coverage is high, a score of 3 is appropriate.

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 core function: 'Returns approximate or exact row count for a single table.' The verb 'returns' and the resource 'row count for a single table' are specific, and the safety note ('Safer than SELECT *') distinguishes it from data-retrieval tools like execute_select_query. It also implies a singular table scope, differentiating it from tools like get_largest_tables.

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

Usage Guidelines4/5

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

The description explicitly advises 'Use before execute_select_query to gauge table size,' providing a clear when-to-use directive. It also conveys safety relative to SELECT * on large tables, which implies it's intended for size estimation rather than data retrieval. However, it doesn't explicitly mention alternatives like explain_select_query or get_largest_tables, so it stops short of full exclusion guidance.

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/jigarkkarangiya/magento-sql-mcp-server'

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