check_consistency
Verify identifier naming patterns for consistency with existing code, providing suggestions to maintain uniform naming conventions.
Instructions
Check if an identifier name is consistent with existing naming patterns.
Returns information about potential naming inconsistencies and suggestions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Implementation Reference
- src/mcp_pyrefly/server.py:304-342 (handler)The 'check_consistency' tool handler, which calls 'session_tracker.check_consistency' to identify naming inconsistencies.
@mcp.tool() async def check_consistency( request: ConsistencyCheckRequest, context: Context ) -> dict[str, Any]: """ Check if an identifier name is consistent with existing naming patterns. Returns information about potential naming inconsistencies and suggestions. """ consistency = session_tracker.check_consistency(request.identifier) if consistency: return { "consistent": False, "issue": consistency["message"], "existing_similar": consistency["existing"], "suggestion": consistency["suggestion"], } # Check if it exists info = session_tracker.get_identifier_info(request.identifier) if info: return { "consistent": True, "exists": True, "info": { "type": info.type, "occurrences": info.occurrences, "first_seen": info.first_seen.isoformat(), "last_seen": info.last_seen.isoformat(), }, } return { "consistent": True, "exists": False, "message": "No consistency issues found", }