Refactoring: Complete Rename of list_symbols_by_query to map_symbols_by_query
Overview
Complete the renaming of list_symbols_by_query to map_symbols_by_query throughout the codebase. The tool is already registered as map_symbols_by_query in the MCP server, but the underlying implementation files still use the old name. This refactoring improves consistency and clarity, as "map" better describes the structured, file-by-file output format.
Current State
- ✅ Tool registered as
map_symbols_by_query in server.ts
- ✅ Documentation file already named
map_symbols_by_query.md
- ❌ Implementation file still named
list_symbols_by_query.ts
- ❌ Test file still named
list_symbols_by_query.test.ts
- ❌ Function and schema names still use
listSymbolsByQuery
- ❌ Legacy documentation file
list_symbols_by_query.md still exists
Implementation Roadmap
Task 1: Rename Implementation File ✅
File: src/mcp_server/tools/list_symbols_by_query.ts → src/mcp_server/tools/map_symbols_by_query.ts
Changes:
- Rename the file from
list_symbols_by_query.ts to map_symbols_by_query.ts
- Update all function names:
listSymbolsByQuery → mapSymbolsByQuery
- Update schema name:
listSymbolsByQuerySchema → mapSymbolsByQuerySchema
- Update type name:
ListSymbolsByQueryParams → MapSymbolsByQueryParams
- Update all internal references and comments
Why: Align implementation file name with the exposed tool name for consistency.
Dependencies: None
Task 2: Update Server Registration ✅
File: src/mcp_server/server.ts
Changes:
- Update import statement to use new file name and function name
- Update schema import name
- Verify tool registration still uses
map_symbols_by_query (should already be correct)
Why: Import paths and names must match the renamed implementation.
Dependencies: Task 1
Key Details:
// Before
import { listSymbolsByQuery, listSymbolsByQuerySchema } from './tools/list_symbols_by_query';
// After
import { mapSymbolsByQuery, mapSymbolsByQuerySchema } from './tools/map_symbols_by_query';
Task 3: Rename Test File ✅
File: tests/mcp_server/list_symbols_by_query.test.ts → tests/mcp_server/map_symbols_by_query.test.ts
Changes:
- Rename the test file from
list_symbols_by_query.test.ts to map_symbols_by_query.test.ts
- Update all imports to use new function and schema names
- Update test suite descriptions from
'list_symbols_by_query' to 'map_symbols_by_query'
- Update function calls to use
mapSymbolsByQuery
Why: Test file names should match implementation file names.
Dependencies: Task 1
Task 4: Delete Legacy Documentation ✅
File: src/mcp_server/tools/list_symbols_by_query.md
Changes:
- Delete the file
list_symbols_by_query.md
- This file is redundant as
map_symbols_by_query.md already exists with updated content
Why: Remove obsolete documentation to avoid confusion.
Dependencies: None
Note: Verify map_symbols_by_query.md has all necessary content before deletion.
Task 5: Update JSDoc Comments ✅
File: src/mcp_server/tools/map_symbols_by_query.ts
Changes:
- Update JSDoc comment for the main function to reference
mapSymbolsByQuery
- Update schema JSDoc to reference
mapSymbolsByQuery tool
- Update any internal comments referencing the old name
Why: Documentation should use the correct function name.
Dependencies: Task 1
Task 6: Search and Replace Remaining References ✅
Files: All files in the codebase
Changes:
- Search for any remaining references to
list_symbols_by_query or listSymbolsByQuery
- Update comments, documentation, or error messages that might reference the old name
- Check for any import statements that might have been missed
Why: Ensure complete consistency across the codebase.
Dependencies: Tasks 1-5
Note: This is a verification task to catch any edge cases.
Task 7: Verify Build and Tests ✅
Files: All test files
Changes:
- Ensure all tests pass with the new names
- Verify TypeScript compilation succeeds
- Run linter to catch any issues
Why: Confirm the refactoring didn't break anything.
Dependencies: Tasks 1-6
Technical Details
File Rename Summary
src/mcp_server/tools/
list_symbols_by_query.ts → map_symbols_by_query.ts
list_symbols_by_query.md → [DELETE]
map_symbols_by_query.md [KEEP - already exists]
tests/mcp_server/
list_symbols_by_query.test.ts → map_symbols_by_query.test.ts
Function Signature Changes
// Before
export const listSymbolsByQuerySchema = z.object({ ... });
export type ListSymbolsByQueryParams = z.infer<typeof listSymbolsByQuerySchema>;
export async function listSymbolsByQuery(params: ListSymbolsByQueryParams): Promise<CallToolResult> { ... }
// After
export const mapSymbolsByQuerySchema = z.object({ ... });
export type MapSymbolsByQueryParams = z.infer<typeof mapSymbolsByQuerySchema>;
export async function mapSymbolsByQuery(params: MapSymbolsByQueryParams): Promise<CallToolResult> { ... }
Import Updates in server.ts
// Before (lines 11-12)
import { listSymbolsByQuery, listSymbolsByQuerySchema } from './tools/list_symbols_by_query';
// After
import { mapSymbolsByQuery, mapSymbolsByQuerySchema } from './tools/map_symbols_by_query';
// Tool registration (lines 59-66) - should already use 'map_symbols_by_query'
this.server.registerTool(
'map_symbols_by_query',
{
description: mapSymbolsByQueryDescription,
inputSchema: mapSymbolsByQuerySchema.shape,
},
mapSymbolsByQuery
);
Test File Updates
// Before
import { listSymbolsByQuery } from '../../src/mcp_server/tools/list_symbols_by_query';
describe('list_symbols_by_query', () => { ... });
const result = await listSymbolsByQuery({ kql: '...' });
// After
import { mapSymbolsByQuery } from '../../src/mcp_server/tools/map_symbols_by_query';
describe('map_symbols_by_query', () => { ... });
const result = await mapSymbolsByQuery({ kql: '...' });
Breaking Changes
None - This is purely an internal refactoring. The tool is already registered as map_symbols_by_query in the MCP server, so external consumers won't be affected.
Refactoring: Complete Rename of list_symbols_by_query to map_symbols_by_query
Overview
Complete the renaming of
list_symbols_by_querytomap_symbols_by_querythroughout the codebase. The tool is already registered asmap_symbols_by_queryin the MCP server, but the underlying implementation files still use the old name. This refactoring improves consistency and clarity, as "map" better describes the structured, file-by-file output format.Current State
map_symbols_by_queryinserver.tsmap_symbols_by_query.mdlist_symbols_by_query.tslist_symbols_by_query.test.tslistSymbolsByQuerylist_symbols_by_query.mdstill existsImplementation Roadmap
Task 1: Rename Implementation File ✅
File:
src/mcp_server/tools/list_symbols_by_query.ts→src/mcp_server/tools/map_symbols_by_query.tsChanges:
list_symbols_by_query.tstomap_symbols_by_query.tslistSymbolsByQuery→mapSymbolsByQuerylistSymbolsByQuerySchema→mapSymbolsByQuerySchemaListSymbolsByQueryParams→MapSymbolsByQueryParamsWhy: Align implementation file name with the exposed tool name for consistency.
Dependencies: None
Task 2: Update Server Registration ✅
File:
src/mcp_server/server.tsChanges:
map_symbols_by_query(should already be correct)Why: Import paths and names must match the renamed implementation.
Dependencies: Task 1
Key Details:
Task 3: Rename Test File ✅
File:
tests/mcp_server/list_symbols_by_query.test.ts→tests/mcp_server/map_symbols_by_query.test.tsChanges:
list_symbols_by_query.test.tstomap_symbols_by_query.test.ts'list_symbols_by_query'to'map_symbols_by_query'mapSymbolsByQueryWhy: Test file names should match implementation file names.
Dependencies: Task 1
Task 4: Delete Legacy Documentation ✅
File:
src/mcp_server/tools/list_symbols_by_query.mdChanges:
list_symbols_by_query.mdmap_symbols_by_query.mdalready exists with updated contentWhy: Remove obsolete documentation to avoid confusion.
Dependencies: None
Note: Verify
map_symbols_by_query.mdhas all necessary content before deletion.Task 5: Update JSDoc Comments ✅
File:
src/mcp_server/tools/map_symbols_by_query.tsChanges:
mapSymbolsByQuerymapSymbolsByQuerytoolWhy: Documentation should use the correct function name.
Dependencies: Task 1
Task 6: Search and Replace Remaining References ✅
Files: All files in the codebase
Changes:
list_symbols_by_queryorlistSymbolsByQueryWhy: Ensure complete consistency across the codebase.
Dependencies: Tasks 1-5
Note: This is a verification task to catch any edge cases.
Task 7: Verify Build and Tests ✅
Files: All test files
Changes:
Why: Confirm the refactoring didn't break anything.
Dependencies: Tasks 1-6
Technical Details
File Rename Summary
Function Signature Changes
Import Updates in server.ts
Test File Updates
Breaking Changes
None - This is purely an internal refactoring. The tool is already registered as
map_symbols_by_queryin the MCP server, so external consumers won't be affected.