Skip to main content
Glama
jigarkkarangiya

magento-sql-mcp-server

Find Order by Increment ID

find_order_by_increment_id
Read-onlyIdempotent

Retrieve a sales order by its increment_id, returning order header and line items (up to 50) without manual SQL JOINs.

Instructions

Looks up a sales order by increment_id and returns order header plus line items (up to 50). Faster than writing JOINs manually. For payment details use execute_select_query on sales_order_payment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.
increment_idYesSales order increment_id (e.g. '000000123'). Use find_order_by_increment_id instead of raw SQL.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
rowsYes
sampledNo
rowCountYes
truncatedNo
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive behavior, so the description's added value lies in disclosing the line-item limit (up to 50) and the performance benefit over raw SQL. This goes beyond annotations and is useful for an agent deciding whether to call it.

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?

Two sentences with zero waste. The primary action is front-loaded, followed by a performance note and a routing alternative. Every sentence earns its place, and the structure is easy for an agent to parse quickly.

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?

For a simple lookup tool with one required parameter, full parameter documentation, an output schema, and safety annotations, this description is complete. It covers the key behavioral limit (50 items), differentiates from a sibling, and provides enough context for correct invocation without over-specifying.

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 the schema already documents all parameters, including an example for increment_id. The description adds minimal parameter-specific information beyond what's in the schema—it reiterates 'instead of raw SQL' and hints at scale, but doesn't need to compensate, so baseline 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?

States a specific verb and resource ('looks up a sales order by increment_id') and clarifies the return scope ('order header plus line items'). It also differentiates from raw SQL and the execute_select_query sibling for payment details, making its purpose unambiguous.

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?

Provides clear context: it is faster than manual JOINs and explicitly names execute_select_query on sales_order_payment as the alternative for payment details. However, it only covers one alternative use case and doesn't enumerate broader when-not-to-use scenarios, so it's strong but not exhaustive.

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