Skip to main content
Glama

get_type_info

Retrieve type information for Python symbols at specific file positions to enable precise code analysis and editing.

Instructions

Get type information for symbol at position (1-based).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
lineYes
columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The get_type_info tool is defined here as an MCP tool, providing type information for a symbol at a given position in a file using the LSP client.
    @mcp.tool()
    async def get_type_info(file_path: str, line: int, column: int) -> str:
        """Get type information for symbol at position (1-based)."""
        client = _get_client()
    
        path = Path(file_path).resolve()
        if not path.exists():
            return _error(f"File not found: {file_path}")
    
        try:
            await client.open_document(path)
            hover_info = await client.get_hover(path, line - 1, column - 1)
    
            if not hover_info:
                return _not_found(f"No type info at {path.name}:{line}:{column}")
    
            return _ok({
                "file": path.name,
                "line": line,
                "column": column,
                "type_info": hover_info
            })
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses the critical '1-based' indexing behavioral trait for the position parameters, but omits read-only nature, error handling on invalid positions, and whether it works for all symbol types.

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

Conciseness4/5

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

Single sentence is appropriately front-loaded and efficient. However, extreme brevity comes at the cost of usage context and parameter documentation; one additional sentence would improve utility without sacrificing clarity.

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?

With output schema present, omitting return value description is acceptable. However, given 0% schema coverage and numerous sibling tools, the description should provide more context about parameters and usage scenarios to be complete.

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 has 0% description coverage (only titles). Description mentions 'position (1-based)' which adds semantic value for line/column parameters but fails to describe 'file_path' or coordinate format expectations, leaving significant gaps uncovered.

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 action ('Get'), resource ('type information'), and target ('symbol at position'). It distinguishes from siblings like 'get_definition' (location vs type) and 'find_usages' (references vs type), though could more explicitly contrast with 'analyze_file'.

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

Usage Guidelines2/5

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

No guidance provided on when to prefer this over 'get_definition' or 'analyze_file', or when type information might be unavailable. No prerequisites mentioned (e.g., project must be started).

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/qinsehm1128/mcp-ty'

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