magector 1.2.11 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/mcp-server.js +95 -80
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magector",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"description": "Semantic code search for Magento 2 — index, search, MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/mcp-server.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"ruvector": "^0.1.96"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@magector/cli-darwin-arm64": "1.2.
|
|
37
|
-
"@magector/cli-linux-x64": "1.2.
|
|
38
|
-
"@magector/cli-linux-arm64": "1.2.
|
|
39
|
-
"@magector/cli-win32-x64": "1.2.
|
|
36
|
+
"@magector/cli-darwin-arm64": "1.2.12",
|
|
37
|
+
"@magector/cli-linux-x64": "1.2.12",
|
|
38
|
+
"@magector/cli-linux-arm64": "1.2.12",
|
|
39
|
+
"@magector/cli-win32-x64": "1.2.12"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"magento",
|
package/src/mcp-server.js
CHANGED
|
@@ -243,6 +243,7 @@ function normalizeResult(r) {
|
|
|
243
243
|
methodName: meta.method_name || meta.methodName,
|
|
244
244
|
methods: meta.methods || [],
|
|
245
245
|
namespace: meta.namespace,
|
|
246
|
+
searchText: meta.search_text || meta.searchText || '',
|
|
246
247
|
isPlugin: meta.is_plugin || meta.isPlugin,
|
|
247
248
|
isController: meta.is_controller || meta.isController,
|
|
248
249
|
isObserver: meta.is_observer || meta.isObserver,
|
|
@@ -287,32 +288,46 @@ function rerank(results, boosts = {}, weight = 0.3) {
|
|
|
287
288
|
|
|
288
289
|
function formatSearchResults(results) {
|
|
289
290
|
if (!results || results.length === 0) {
|
|
290
|
-
return
|
|
291
|
+
return JSON.stringify({ results: [], count: 0 });
|
|
291
292
|
}
|
|
292
293
|
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if (r.
|
|
311
|
-
if (r.
|
|
312
|
-
if (r.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
294
|
+
const formatted = results.map((r, i) => {
|
|
295
|
+
const entry = {
|
|
296
|
+
rank: i + 1,
|
|
297
|
+
score: r.score ? parseFloat(r.score.toFixed(3)) : null,
|
|
298
|
+
path: r.path || 'unknown',
|
|
299
|
+
};
|
|
300
|
+
if (r.module) entry.module = r.module;
|
|
301
|
+
if (r.className) entry.className = r.className;
|
|
302
|
+
if (r.namespace) entry.namespace = r.namespace;
|
|
303
|
+
if (r.methodName) entry.methodName = r.methodName;
|
|
304
|
+
if (r.methods && r.methods.length > 0) entry.methods = r.methods;
|
|
305
|
+
if (r.magentoType) entry.magentoType = r.magentoType;
|
|
306
|
+
if (r.type) entry.fileType = r.type;
|
|
307
|
+
if (r.area && r.area !== 'global') entry.area = r.area;
|
|
308
|
+
|
|
309
|
+
// Badges — concise role indicators
|
|
310
|
+
const badges = [];
|
|
311
|
+
if (r.isPlugin) badges.push('plugin');
|
|
312
|
+
if (r.isController) badges.push('controller');
|
|
313
|
+
if (r.isObserver) badges.push('observer');
|
|
314
|
+
if (r.isRepository) badges.push('repository');
|
|
315
|
+
if (r.isResolver) badges.push('graphql-resolver');
|
|
316
|
+
if (r.isModel) badges.push('model');
|
|
317
|
+
if (r.isBlock) badges.push('block');
|
|
318
|
+
if (badges.length > 0) entry.badges = badges;
|
|
319
|
+
|
|
320
|
+
// Snippet — first 300 chars of indexed content for quick assessment
|
|
321
|
+
if (r.searchText) {
|
|
322
|
+
entry.snippet = r.searchText.length > 300
|
|
323
|
+
? r.searchText.slice(0, 300) + '...'
|
|
324
|
+
: r.searchText;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return entry;
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
return JSON.stringify({ results: formatted, count: formatted.length });
|
|
316
331
|
}
|
|
317
332
|
|
|
318
333
|
// ─── MCP Server ─────────────────────────────────────────────────
|
|
@@ -334,17 +349,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
334
349
|
tools: [
|
|
335
350
|
{
|
|
336
351
|
name: 'magento_search',
|
|
337
|
-
description: 'Search Magento codebase semantically
|
|
352
|
+
description: '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. See also: magento_find_class, magento_find_method, magento_find_config for targeted searches.',
|
|
338
353
|
inputSchema: {
|
|
339
354
|
type: 'object',
|
|
340
355
|
properties: {
|
|
341
356
|
query: {
|
|
342
357
|
type: 'string',
|
|
343
|
-
description: 'Natural language search query
|
|
358
|
+
description: 'Natural language search query describing what you want to find. Examples: "product price calculation logic", "checkout controller", "customer authentication", "add to cart", "order placement flow"'
|
|
344
359
|
},
|
|
345
360
|
limit: {
|
|
346
361
|
type: 'number',
|
|
347
|
-
description: 'Maximum results to return (default: 10)',
|
|
362
|
+
description: 'Maximum results to return (default: 10, max: 100)',
|
|
348
363
|
default: 10
|
|
349
364
|
}
|
|
350
365
|
},
|
|
@@ -353,17 +368,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
353
368
|
},
|
|
354
369
|
{
|
|
355
370
|
name: 'magento_find_class',
|
|
356
|
-
description: 'Find a
|
|
371
|
+
description: 'Find a PHP class, interface, abstract class, or trait by name in Magento. Locates repositories, models, resource models, blocks, helpers, controllers, API interfaces, and data objects. See also: magento_find_plugin (interceptors for this class), magento_find_preference (DI overrides), magento_find_method (methods in the class).',
|
|
357
372
|
inputSchema: {
|
|
358
373
|
type: 'object',
|
|
359
374
|
properties: {
|
|
360
375
|
className: {
|
|
361
376
|
type: 'string',
|
|
362
|
-
description: '
|
|
377
|
+
description: 'Full or partial PHP class name. Examples: "ProductRepository", "AbstractModel", "CartManagementInterface", "CustomerData", "StockItemRepository"'
|
|
363
378
|
},
|
|
364
379
|
namespace: {
|
|
365
380
|
type: 'string',
|
|
366
|
-
description: 'Optional namespace filter'
|
|
381
|
+
description: 'Optional PHP namespace filter to narrow results. Example: "Magento\\Catalog\\Model"'
|
|
367
382
|
}
|
|
368
383
|
},
|
|
369
384
|
required: ['className']
|
|
@@ -371,17 +386,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
371
386
|
},
|
|
372
387
|
{
|
|
373
388
|
name: 'magento_find_method',
|
|
374
|
-
description: 'Find implementations of a
|
|
389
|
+
description: 'Find implementations of a PHP method or function across the Magento codebase. Searches method names, function definitions, and class method lists. See also: magento_find_class (parent class), magento_find_plugin (interceptors around this method).',
|
|
375
390
|
inputSchema: {
|
|
376
391
|
type: 'object',
|
|
377
392
|
properties: {
|
|
378
393
|
methodName: {
|
|
379
394
|
type: 'string',
|
|
380
|
-
description: '
|
|
395
|
+
description: 'PHP method or function name to find. Examples: "execute", "getPrice", "save", "getById", "getList", "beforeSave", "afterDelete", "toHtml", "dispatch"'
|
|
381
396
|
},
|
|
382
397
|
className: {
|
|
383
398
|
type: 'string',
|
|
384
|
-
description: 'Optional class name
|
|
399
|
+
description: 'Optional class name to narrow method search. Example: "ProductRepository"'
|
|
385
400
|
}
|
|
386
401
|
},
|
|
387
402
|
required: ['methodName']
|
|
@@ -389,18 +404,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
389
404
|
},
|
|
390
405
|
{
|
|
391
406
|
name: 'magento_find_config',
|
|
392
|
-
description: 'Find XML configuration files and nodes in Magento',
|
|
407
|
+
description: 'Find XML configuration files and nodes in Magento — di.xml (dependency injection), events.xml (observers), routes.xml (routing), system.xml (admin config), webapi.xml (REST/SOAP), module.xml (module declarations), layout XML. See also: magento_find_observer (events.xml), magento_find_preference (di.xml), magento_find_api (webapi.xml).',
|
|
393
408
|
inputSchema: {
|
|
394
409
|
type: 'object',
|
|
395
410
|
properties: {
|
|
396
411
|
query: {
|
|
397
412
|
type: 'string',
|
|
398
|
-
description: '
|
|
413
|
+
description: 'What configuration to find. Examples: "di.xml preference for ProductRepository", "routes.xml catalog", "system.xml payment field", "events.xml checkout", "layout xml catalog_product_view"'
|
|
399
414
|
},
|
|
400
415
|
configType: {
|
|
401
416
|
type: 'string',
|
|
402
417
|
enum: ['di', 'routes', 'system', 'events', 'webapi', 'module', 'layout', 'other'],
|
|
403
|
-
description: 'Type of configuration'
|
|
418
|
+
description: 'Type of XML configuration: di (dependency injection/preferences/virtualTypes), routes (URL routing), system (admin config fields/sections), events (event observers/listeners), webapi (REST/SOAP endpoint definitions), module (module.xml declarations/setup_version), layout (page layout XML/blocks/containers)'
|
|
404
419
|
}
|
|
405
420
|
},
|
|
406
421
|
required: ['query']
|
|
@@ -408,18 +423,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
408
423
|
},
|
|
409
424
|
{
|
|
410
425
|
name: 'magento_find_template',
|
|
411
|
-
description: 'Find PHTML
|
|
426
|
+
description: 'Find PHTML template files in Magento for frontend or admin rendering. Locates view templates for product pages, checkout, customer account, cart, CMS, catalog listing, and more. See also: magento_find_block (Block class rendering the template).',
|
|
412
427
|
inputSchema: {
|
|
413
428
|
type: 'object',
|
|
414
429
|
properties: {
|
|
415
430
|
query: {
|
|
416
431
|
type: 'string',
|
|
417
|
-
description: 'Template description
|
|
432
|
+
description: 'Template description or filename pattern. Examples: "product listing", "checkout form", "customer account dashboard", "minicart", "breadcrumbs", "category view", "order summary"'
|
|
418
433
|
},
|
|
419
434
|
area: {
|
|
420
435
|
type: 'string',
|
|
421
436
|
enum: ['frontend', 'adminhtml', 'base'],
|
|
422
|
-
description: 'Magento area'
|
|
437
|
+
description: 'Magento area: frontend (customer-facing storefront), adminhtml (admin panel), base (shared/fallback)'
|
|
423
438
|
}
|
|
424
439
|
},
|
|
425
440
|
required: ['query']
|
|
@@ -427,20 +442,20 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
427
442
|
},
|
|
428
443
|
{
|
|
429
444
|
name: 'magento_index',
|
|
430
|
-
description: 'Index or re-index Magento codebase for semantic search
|
|
445
|
+
description: 'Index or re-index the Magento codebase for semantic search. Run this after code changes to update the search index. Indexes PHP, XML, JS, PHTML, and GraphQL files.',
|
|
431
446
|
inputSchema: {
|
|
432
447
|
type: 'object',
|
|
433
448
|
properties: {
|
|
434
449
|
path: {
|
|
435
450
|
type: 'string',
|
|
436
|
-
description: '
|
|
451
|
+
description: 'Absolute path to Magento 2 root directory. Uses configured MAGENTO_ROOT if not specified.'
|
|
437
452
|
},
|
|
438
453
|
}
|
|
439
454
|
}
|
|
440
455
|
},
|
|
441
456
|
{
|
|
442
457
|
name: 'magento_stats',
|
|
443
|
-
description: 'Get index statistics
|
|
458
|
+
description: 'Get index statistics — total indexed vectors, embedding dimensions, and database path. Use this to verify the index is loaded and check its size.',
|
|
444
459
|
inputSchema: {
|
|
445
460
|
type: 'object',
|
|
446
461
|
properties: {}
|
|
@@ -448,30 +463,30 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
448
463
|
},
|
|
449
464
|
{
|
|
450
465
|
name: 'magento_find_plugin',
|
|
451
|
-
description: 'Find plugins (interceptors)
|
|
466
|
+
description: 'Find Magento plugins (interceptors) that modify class behavior via before/after/around methods. Locates Plugin classes and di.xml interceptor declarations. See also: magento_find_class (target class details), magento_find_method (intercepted method), magento_find_config with configType=di.',
|
|
452
467
|
inputSchema: {
|
|
453
468
|
type: 'object',
|
|
454
469
|
properties: {
|
|
455
470
|
targetClass: {
|
|
456
471
|
type: 'string',
|
|
457
|
-
description: 'Class being intercepted
|
|
472
|
+
description: 'Class being intercepted by plugins. Examples: "ProductRepository", "CartManagement", "CustomerRepository", "OrderRepository", "Topmenu"'
|
|
458
473
|
},
|
|
459
474
|
targetMethod: {
|
|
460
475
|
type: 'string',
|
|
461
|
-
description: '
|
|
476
|
+
description: 'Specific method being intercepted. Examples: "save", "getList", "getById", "getHtml", "dispatch"'
|
|
462
477
|
}
|
|
463
478
|
}
|
|
464
479
|
}
|
|
465
480
|
},
|
|
466
481
|
{
|
|
467
482
|
name: 'magento_find_observer',
|
|
468
|
-
description: 'Find observers for a
|
|
483
|
+
description: 'Find event observers (listeners) for a Magento event. Locates Observer classes and events.xml declarations. See also: magento_find_config with configType=events for raw XML.',
|
|
469
484
|
inputSchema: {
|
|
470
485
|
type: 'object',
|
|
471
486
|
properties: {
|
|
472
487
|
eventName: {
|
|
473
488
|
type: 'string',
|
|
474
|
-
description: '
|
|
489
|
+
description: 'Magento event name. Examples: "checkout_cart_add_product_complete", "sales_order_place_after", "catalog_product_save_after", "customer_login", "controller_action_predispatch"'
|
|
475
490
|
}
|
|
476
491
|
},
|
|
477
492
|
required: ['eventName']
|
|
@@ -479,13 +494,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
479
494
|
},
|
|
480
495
|
{
|
|
481
496
|
name: 'magento_find_preference',
|
|
482
|
-
description: 'Find DI preference overrides
|
|
497
|
+
description: 'Find DI preference overrides — which concrete class implements an interface or replaces another class via di.xml. See also: magento_find_class (implementation details), magento_find_config with configType=di.',
|
|
483
498
|
inputSchema: {
|
|
484
499
|
type: 'object',
|
|
485
500
|
properties: {
|
|
486
501
|
interfaceName: {
|
|
487
502
|
type: 'string',
|
|
488
|
-
description: 'Interface or class name to find
|
|
503
|
+
description: 'Interface or class name to find preference/implementation for. Examples: "ProductRepositoryInterface", "StoreManagerInterface", "LoggerInterface", "OrderRepositoryInterface", "CustomerRepositoryInterface"'
|
|
489
504
|
}
|
|
490
505
|
},
|
|
491
506
|
required: ['interfaceName']
|
|
@@ -493,18 +508,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
493
508
|
},
|
|
494
509
|
{
|
|
495
510
|
name: 'magento_find_api',
|
|
496
|
-
description: 'Find REST
|
|
511
|
+
description: 'Find REST and SOAP API endpoint definitions in webapi.xml and their service class implementations. See also: magento_find_config with configType=webapi, magento_find_class (service class).',
|
|
497
512
|
inputSchema: {
|
|
498
513
|
type: 'object',
|
|
499
514
|
properties: {
|
|
500
515
|
query: {
|
|
501
516
|
type: 'string',
|
|
502
|
-
description: 'API endpoint URL pattern or service method
|
|
517
|
+
description: 'API endpoint URL pattern or service method name. Examples: "/V1/products", "/V1/orders", "/V1/carts", "/V1/customers", "/V1/categories", "getList", "save"'
|
|
503
518
|
},
|
|
504
519
|
method: {
|
|
505
520
|
type: 'string',
|
|
506
521
|
enum: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
507
|
-
description: 'HTTP method
|
|
522
|
+
description: 'Filter by HTTP method: GET (read), POST (create), PUT (update), DELETE (remove)'
|
|
508
523
|
}
|
|
509
524
|
},
|
|
510
525
|
required: ['query']
|
|
@@ -512,18 +527,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
512
527
|
},
|
|
513
528
|
{
|
|
514
529
|
name: 'magento_find_controller',
|
|
515
|
-
description: 'Find controllers by
|
|
530
|
+
description: 'Find MVC controllers by frontend or admin route path. Maps URL routes to Controller action classes with execute() method. See also: magento_find_config with configType=routes.',
|
|
516
531
|
inputSchema: {
|
|
517
532
|
type: 'object',
|
|
518
533
|
properties: {
|
|
519
534
|
route: {
|
|
520
535
|
type: 'string',
|
|
521
|
-
description: '
|
|
536
|
+
description: 'URL route path in frontName/controller/action format. Examples: "catalog/product/view", "checkout/cart/add", "customer/account/login", "sales/order/view", "cms/page/view", "wishlist/index/add"'
|
|
522
537
|
},
|
|
523
538
|
area: {
|
|
524
539
|
type: 'string',
|
|
525
540
|
enum: ['frontend', 'adminhtml'],
|
|
526
|
-
description: 'Magento area'
|
|
541
|
+
description: 'Magento area: frontend (storefront routes) or adminhtml (admin panel routes)'
|
|
527
542
|
}
|
|
528
543
|
},
|
|
529
544
|
required: ['route']
|
|
@@ -531,13 +546,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
531
546
|
},
|
|
532
547
|
{
|
|
533
548
|
name: 'magento_find_block',
|
|
534
|
-
description: 'Find Block classes by
|
|
549
|
+
description: 'Find Magento Block classes used for view rendering and template logic. Blocks bridge controllers and templates. See also: magento_find_template (PHTML template rendered by the block), magento_find_config with configType=layout.',
|
|
535
550
|
inputSchema: {
|
|
536
551
|
type: 'object',
|
|
537
552
|
properties: {
|
|
538
553
|
query: {
|
|
539
554
|
type: 'string',
|
|
540
|
-
description: 'Block class name or functionality
|
|
555
|
+
description: 'Block class name or functionality description. Examples: "Product\\View", "cart totals", "category listing", "customer account navigation", "order view", "Topmenu"'
|
|
541
556
|
}
|
|
542
557
|
},
|
|
543
558
|
required: ['query']
|
|
@@ -545,13 +560,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
545
560
|
},
|
|
546
561
|
{
|
|
547
562
|
name: 'magento_find_cron',
|
|
548
|
-
description: 'Find cron jobs
|
|
563
|
+
description: 'Find scheduled cron jobs defined in crontab.xml and their handler classes in Cron/ directories. See also: magento_find_config for crontab.xml raw XML.',
|
|
549
564
|
inputSchema: {
|
|
550
565
|
type: 'object',
|
|
551
566
|
properties: {
|
|
552
567
|
jobName: {
|
|
553
568
|
type: 'string',
|
|
554
|
-
description: 'Cron job name or
|
|
569
|
+
description: 'Cron job name or keyword. Examples: "catalog_product", "indexer", "sitemap", "currency", "newsletter", "reindex", "aggregate", "clean"'
|
|
555
570
|
}
|
|
556
571
|
},
|
|
557
572
|
required: ['jobName']
|
|
@@ -559,18 +574,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
559
574
|
},
|
|
560
575
|
{
|
|
561
576
|
name: 'magento_find_graphql',
|
|
562
|
-
description: 'Find GraphQL types, queries, mutations,
|
|
577
|
+
description: 'Find GraphQL schema definitions (.graphqls), types, queries, mutations, and resolver PHP classes. See also: magento_find_class (resolver implementation), magento_find_method (resolver execute method).',
|
|
563
578
|
inputSchema: {
|
|
564
579
|
type: 'object',
|
|
565
580
|
properties: {
|
|
566
581
|
query: {
|
|
567
582
|
type: 'string',
|
|
568
|
-
description: 'GraphQL type, query, or
|
|
583
|
+
description: 'GraphQL type, query, mutation, or interface name. Examples: "products", "createCustomer", "CartItemInterface", "cart", "categoryList", "placeOrder", "createEmptyCart"'
|
|
569
584
|
},
|
|
570
585
|
schemaType: {
|
|
571
586
|
type: 'string',
|
|
572
587
|
enum: ['type', 'query', 'mutation', 'interface', 'resolver'],
|
|
573
|
-
description: '
|
|
588
|
+
description: 'Filter by GraphQL schema element: type (object types), query (read operations), mutation (write operations), interface (shared contracts), resolver (PHP resolver classes)'
|
|
574
589
|
}
|
|
575
590
|
},
|
|
576
591
|
required: ['query']
|
|
@@ -578,13 +593,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
578
593
|
},
|
|
579
594
|
{
|
|
580
595
|
name: 'magento_find_db_schema',
|
|
581
|
-
description: 'Find database table definitions and
|
|
596
|
+
description: 'Find database table definitions, columns, indexes, and constraints declared in db_schema.xml (Magento declarative schema). See also: magento_find_class (model/resource model for the table).',
|
|
582
597
|
inputSchema: {
|
|
583
598
|
type: 'object',
|
|
584
599
|
properties: {
|
|
585
600
|
tableName: {
|
|
586
601
|
type: 'string',
|
|
587
|
-
description: '
|
|
602
|
+
description: 'Database table name or pattern. Examples: "catalog_product_entity", "sales_order", "customer_entity", "quote", "cms_page", "inventory_source"'
|
|
588
603
|
}
|
|
589
604
|
},
|
|
590
605
|
required: ['tableName']
|
|
@@ -592,13 +607,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
592
607
|
},
|
|
593
608
|
{
|
|
594
609
|
name: 'magento_module_structure',
|
|
595
|
-
description: 'Get complete structure of a Magento module
|
|
610
|
+
description: 'Get the complete structure of a Magento module — lists all controllers, models, blocks, plugins, observers, API classes, XML configs, and templates. Provides an overview of module architecture.',
|
|
596
611
|
inputSchema: {
|
|
597
612
|
type: 'object',
|
|
598
613
|
properties: {
|
|
599
614
|
moduleName: {
|
|
600
615
|
type: 'string',
|
|
601
|
-
description: 'Full module name
|
|
616
|
+
description: 'Full Magento module name in Vendor_Module format. Examples: "Magento_Catalog", "Magento_Sales", "Magento_Customer", "Magento_Checkout", "Vendor_CustomModule"'
|
|
602
617
|
}
|
|
603
618
|
},
|
|
604
619
|
required: ['moduleName']
|
|
@@ -606,17 +621,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
606
621
|
},
|
|
607
622
|
{
|
|
608
623
|
name: 'magento_analyze_diff',
|
|
609
|
-
description: 'Analyze git diffs for risk scoring, change classification, and per-file analysis. Works on commits or staged changes.',
|
|
624
|
+
description: 'Analyze git diffs for risk scoring, change classification, and per-file impact analysis. Works on specific commits or staged changes. Useful for code review.',
|
|
610
625
|
inputSchema: {
|
|
611
626
|
type: 'object',
|
|
612
627
|
properties: {
|
|
613
628
|
commitHash: {
|
|
614
629
|
type: 'string',
|
|
615
|
-
description: 'Git commit hash to analyze. If omitted, analyzes staged changes.'
|
|
630
|
+
description: 'Git commit hash to analyze. If omitted, analyzes currently staged (git add) changes instead.'
|
|
616
631
|
},
|
|
617
632
|
staged: {
|
|
618
633
|
type: 'boolean',
|
|
619
|
-
description: '
|
|
634
|
+
description: 'Set true to analyze staged changes, false to require commitHash. Default: true.',
|
|
620
635
|
default: true
|
|
621
636
|
}
|
|
622
637
|
}
|
|
@@ -624,21 +639,21 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
624
639
|
},
|
|
625
640
|
{
|
|
626
641
|
name: 'magento_complexity',
|
|
627
|
-
description: 'Analyze code complexity
|
|
642
|
+
description: 'Analyze code complexity — cyclomatic complexity, function count, and line count for PHP files. Identifies complex hotspots and rates each file. Use for refactoring prioritization.',
|
|
628
643
|
inputSchema: {
|
|
629
644
|
type: 'object',
|
|
630
645
|
properties: {
|
|
631
646
|
module: {
|
|
632
647
|
type: 'string',
|
|
633
|
-
description: 'Magento module to analyze
|
|
648
|
+
description: 'Magento module to analyze. Finds all PHP files in the module. Examples: "Magento_Catalog", "Magento_Checkout", "Magento_Sales"'
|
|
634
649
|
},
|
|
635
650
|
path: {
|
|
636
651
|
type: 'string',
|
|
637
|
-
description: 'Specific file or directory path to analyze'
|
|
652
|
+
description: 'Specific file or directory path to analyze instead of a module name'
|
|
638
653
|
},
|
|
639
654
|
threshold: {
|
|
640
655
|
type: 'number',
|
|
641
|
-
description: 'Minimum cyclomatic complexity to report (
|
|
656
|
+
description: 'Minimum cyclomatic complexity to report. Set higher (e.g., 10) to only see complex files. Default: 0 (show all)',
|
|
642
657
|
default: 0
|
|
643
658
|
}
|
|
644
659
|
}
|
|
@@ -793,7 +808,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
793
808
|
return {
|
|
794
809
|
content: [{
|
|
795
810
|
type: 'text',
|
|
796
|
-
text:
|
|
811
|
+
text: formatSearchResults(results.slice(0, 15))
|
|
797
812
|
}]
|
|
798
813
|
};
|
|
799
814
|
}
|
|
@@ -809,7 +824,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
809
824
|
return {
|
|
810
825
|
content: [{
|
|
811
826
|
type: 'text',
|
|
812
|
-
text:
|
|
827
|
+
text: formatSearchResults(results.slice(0, 15))
|
|
813
828
|
}]
|
|
814
829
|
};
|
|
815
830
|
}
|
|
@@ -824,7 +839,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
824
839
|
return {
|
|
825
840
|
content: [{
|
|
826
841
|
type: 'text',
|
|
827
|
-
text:
|
|
842
|
+
text: formatSearchResults(results.slice(0, 15))
|
|
828
843
|
}]
|
|
829
844
|
};
|
|
830
845
|
}
|
|
@@ -859,7 +874,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
859
874
|
return {
|
|
860
875
|
content: [{
|
|
861
876
|
type: 'text',
|
|
862
|
-
text:
|
|
877
|
+
text: formatSearchResults(results)
|
|
863
878
|
}]
|
|
864
879
|
};
|
|
865
880
|
}
|
|
@@ -891,7 +906,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
891
906
|
return {
|
|
892
907
|
content: [{
|
|
893
908
|
type: 'text',
|
|
894
|
-
text:
|
|
909
|
+
text: formatSearchResults(results.slice(0, 15))
|
|
895
910
|
}]
|
|
896
911
|
};
|
|
897
912
|
}
|
|
@@ -910,7 +925,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
910
925
|
return {
|
|
911
926
|
content: [{
|
|
912
927
|
type: 'text',
|
|
913
|
-
text:
|
|
928
|
+
text: formatSearchResults(results.slice(0, 15))
|
|
914
929
|
}]
|
|
915
930
|
};
|
|
916
931
|
}
|
|
@@ -926,7 +941,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
926
941
|
return {
|
|
927
942
|
content: [{
|
|
928
943
|
type: 'text',
|
|
929
|
-
text:
|
|
944
|
+
text: formatSearchResults(results.slice(0, 15))
|
|
930
945
|
}]
|
|
931
946
|
};
|
|
932
947
|
}
|