Skip to main content
Glama

track_identifier

Register identifiers to ensure consistent usage across codebases. This tool tracks function, variable, class, method, and constant names for consistency checking.

Instructions

Explicitly track an identifier for consistency checking.

Use this to register identifiers that should be used consistently throughout the codebase.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function `track_identifier` which is exposed as an MCP tool. It calls `session_tracker.track_identifier`.
    async def track_identifier(
        request: IdentifierTrackRequest, context: Context
    ) -> dict[str, Any]:
        """
        Explicitly track an identifier for consistency checking.
    
        Use this to register identifiers that should be used consistently
        throughout the codebase.
        """
        session_tracker.track_identifier(
            name=request.name,
            id_type=request.type,
            signature=request.signature,
            file_path=request.file_path,
        )
    
        return {
            "tracked": True,
            "identifier": request.name,
            "type": request.type,
            "timestamp": datetime.now().isoformat(),
        }
  • The input schema for the `track_identifier` tool.
    class IdentifierTrackRequest(BaseModel):
        """Request model for identifier tracking."""
    
        name: str = Field(..., description="Identifier name")
        type: str = Field(
            ..., description="Type: function, variable, class, method, constant"
        )
        signature: str | None = Field(None, description="Function/method signature")
        file_path: str | None = Field(None, description="File where identifier is defined")
  • The implementation of `SessionTracker.track_identifier` which actually stores the identifier information.
    def track_identifier(
        self,
        name: str,
        id_type: str,
        signature: str | None = None,
        file_path: str | None = None,
    ) -> None:
        """Track an identifier usage."""
        if name in self.identifiers:
            info = self.identifiers[name]
            info.occurrences += 1
            info.last_seen = datetime.now()
            if signature and signature not in info.signatures:
                info.signatures.append(signature)
            if file_path:
                info.file_locations.add(file_path)
        else:
            self.identifiers[name] = IdentifierInfo(
                name=name,
                type=id_type,
                first_seen=datetime.now(),
                last_seen=datetime.now(),
                signatures=[signature] if signature else [],
                file_locations={file_path} if file_path else set(),
            )
            self._update_similar_names(name)
    
    def _update_similar_names(self, name: str) -> None:
        """Update similar names mapping for consistency checking."""
        # Convert between naming conventions
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'track' and 'register' which imply a write/mutation operation, but doesn't specify permissions needed, whether this is idempotent, what happens on duplicate registration, or any rate limits. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two sentences that directly state purpose and usage. Every word earns its place with zero waste or redundancy. It's appropriately sized for a simple tracking tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), no annotations, and simple parameters, the description is minimally complete. However, for a mutation tool with 0% schema description coverage, it should provide more parameter guidance and behavioral context. The description covers basic purpose but leaves significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. The description mentions 'identifier' but doesn't explain what parameters are needed (name, type, signature, file_path) or their semantics. It fails to add meaningful parameter information beyond what's implied by the tool name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Explicitly track an identifier for consistency checking' and 'register identifiers that should be used consistently throughout the codebase.' It specifies the verb ('track', 'register') and resource ('identifier'), but doesn't explicitly differentiate from sibling tools like 'list_identifiers' or 'check_consistency'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context: 'Use this to register identifiers that should be used consistently throughout the codebase.' This implies when to use it (for consistency checking), but doesn't explicitly state when not to use it or mention alternatives among sibling tools like 'check_consistency' or 'list_identifiers'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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