Skip to main content
Glama

magento_search

Search Magento codebases semantically using natural language to find PHP classes, methods, XML configs, PHTML templates, JS files, or GraphQL schemas.

Instructions

Search Magento codebase semantically — find any PHP class, method, XML config, PHTML template, JS file, or GraphQL schema by describing what you need in natural language. Use this as a general-purpose search when no specialized tool fits. Works best for Magento core and popular vendor modules. For small/custom project-specific modules (e.g. proprietary modules not widely known to the embedding model), use magento_grep instead — semantic search may return 0 results for these. See also: magento_find_class, magento_find_method, magento_find_config for targeted searches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results to return (default: 10, max: 100)
queryYesNatural language search query describing what you want to find. Examples: "product price calculation logic", "checkout controller", "customer authentication", "add to cart", "order placement flow"
expandNoEnable query expansion with Magento domain synonyms for better recall (default: true)
preciseNoPrecise mode for debugging: disables query expansion AND applies strict post-filtering — only returns results where the file content contains at least one query keyword. Use for specific debugging queries like "gift card subtotal infinite loop". Default: false.
moduleFilterNoFilter results by vendor/module pattern(s). Accepts a single string or array of strings. Supports wildcards and vendor prefix matching. Uses "/" or "_" interchangeably as separator. Examples: "Vendor_*", ["Acme_PaymentGateway", "Acme_FreeShipping"], "Magento_Catalog".
excludeModuleFilterNoExclude results from vendor/module pattern(s). Inverse of moduleFilter — removes matching modules from results. Same pattern syntax as moduleFilter. Useful when you know which modules are irrelevant. Examples: "Vendor_MarketplaceBase", ["Vendor_ModuleA", "Vendor_ModuleB"].
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses limitations: 'Works best for Magento core... semantic search may return 0 results' for custom modules. It also explains behavioral effects of parameters like 'precise' and 'expand'. However, it does not explicitly state that the tool is read-only or mention any side effects. Still, the provided limitations and parameter behavior give solid transparency.

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?

Description is front-loaded with the main purpose and usage context. Every sentence serves a purpose: first defines tool, second gives usage guidelines, third mentions limitations, fourth lists alternatives. No redundant or filler text. It is appropriately sized for the tool's complexity.

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 large set of sibling tools, the description adequately positions this tool as a general-purpose fallback and explains its limitations regarding custom modules. However, it does not describe the return format or ranking behavior, which could help an agent interpret results. Since no output schema is provided, a brief note on what results look like would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds meaningful context beyond the schema: for 'precise' it clarifies 'disables query expansion AND applies strict post-filtering'; for 'expand' it mentions 'Magento domain synonyms'; and for query it provides concrete examples. This adds value for an agent to construct proper requests.

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?

Description starts with a clear verb+resource: 'Search Magento codebase semantically... find any PHP class, method, XML config...' It specifies the resource (Magento codebase) and the action (semantic search). Additionally, it distinguishes itself from sibling tools by stating 'Use this as a general-purpose search when no specialized tool fits' and listing alternatives like magento_find_class.

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

Usage Guidelines5/5

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

Explicitly states when to use: 'general-purpose search when no specialized tool fits' and when not to use: 'for small/custom project-specific modules... use magento_grep instead.' It also references sibling tools with 'See also: magento_find_class, magento_find_method, magento_find_config for targeted searches.' This provides clear guidance on 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/krejcif/magector'

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