Skip to content

Improve get_doc name resolution with normalization and alias map#1727

Open
onlyexeption wants to merge 3 commits into
masterfrom
ibarakov/enhance-mcp-tools
Open

Improve get_doc name resolution with normalization and alias map#1727
onlyexeption wants to merge 3 commits into
masterfrom
ibarakov/enhance-mcp-tools

Conversation

@onlyexeption

Copy link
Copy Markdown
Contributor

Description

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration change

Affected Packages

  • igniteui-cli (packages/cli)
  • @igniteui/cli-core (packages/core)
  • @igniteui/angular-templates (packages/igx-templates)
  • @igniteui/angular-schematics (packages/ng-schematics)
  • @igniteui/mcp-server (packages/igniteui-mcp)

Checklist

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

Additional Context

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the get_doc tool in the Ignite UI MCP server by resolving documentation names more flexibly, allowing callers to use framework component class names (e.g., IgxGridComponent, IgrCombo) and mapping them to the correct doc keys via normalization + per-framework aliases.

Changes:

  • Added normalizeDocName() to convert common component class naming patterns to kebab-case doc keys.
  • Introduced per-framework alias maps and applyDocAlias() to handle non-mechanical doc key mappings.
  • Updated the get_doc tool handler to normalize + alias the requested doc name before fetching.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/igniteui-mcp/igniteui-doc-mcp/src/tools/doc-tools.ts Adds doc name normalization plus framework-specific alias resolution helpers and alias tables.
packages/igniteui-mcp/igniteui-doc-mcp/src/index.ts Applies normalization + aliasing in the get_doc tool handler before calling docsProvider.getDoc().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/igniteui-mcp/igniteui-doc-mcp/src/index.ts
Comment thread packages/igniteui-mcp/igniteui-doc-mcp/src/tools/doc-tools.ts
@coveralls

coveralls commented Jun 9, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 87.785% (-0.3%) from 88.077% — ibarakov/enhance-mcp-tools into master

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (1)

packages/igniteui-mcp/igniteui-doc-mcp/src/index.ts:141

  • get_doc now trims/normalizes/aliases the provided name, so the schema description is no longer accurate when it says "Exact doc name in kebab-case". Update it to reflect that component class names like IgxGridComponent are accepted too.
          .describe(
            'Exact doc name in kebab-case without the .md extension. ' +
            'Examples: "grid-editing", "combo-overview", "accordion". ' +
            'Get valid names from list_components or search_docs.'

'combo-single-selection': 'single-selection',
'combobox-single-selection': 'single-selection',
// Grid
grid: 'grid-grid',
Comment on lines +102 to +106
angular: {
// Combo Box
'combo-box': 'combo',
combobox: 'combo',
// Grid -overview suffix
Comment on lines +120 to +124
webcomponents: {
// Combo Box
combo: 'overview',
'combo-box': 'overview',
combobox: 'overview',
Comment on lines +140 to +144
blazor: {
// Combo Box
combo: 'overview',
'combo-box': 'overview',
combobox: 'overview',
* Covers cases where the doc key cannot be derived mechanically:
* - Combo Box overview is keyed as "overview" not "combo" / "combo-box"
* - Combo sub-docs use bare generic names: "features", "templates", "single-selection"
* - Grid overview is "data-grid", not "grid"
Comment on lines +145 to +147
it('resolves react grid to grid-grid', () => {
expect(applyDocAlias('react', 'grid')).toBe('grid-grid');
});
Comment on lines +177 to +180
it('IgxGridComponent normalizes then aliases correctly for angular', () => {
const normalized = normalizeDocName('IgxGridComponent');
expect(applyDocAlias('angular', normalized)).toBe('grid');
});
Comment on lines +157 to +172
it('resolves angular hierarchical-grid correctly', () => {
expect(applyDocAlias('angular', 'hierarchical-grid')).toBe('hierarchicalgrid-hierarchical-grid');
});

it('resolves webcomponents combo to overview', () => {
expect(applyDocAlias('webcomponents', 'combo')).toBe('overview');
});

it('resolves blazor radio-group to radio', () => {
expect(applyDocAlias('blazor', 'radio-group')).toBe('radio');
});

it('resolves blazor range-slider to slider', () => {
expect(applyDocAlias('blazor', 'range-slider')).toBe('slider');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants