Skip to main content
Glama

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
NameRequiredDescriptionDefault
requestYes

Implementation Reference

  • 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",
        }

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/kimasplund/mcp-pyrefly'

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