Skip to main content
Glama

get_cursor_position

Retrieve the cursor position (x, y) within the visible screen of an iTerm2 session. Helps in automating terminal interactions by identifying cursor location.

Instructions

Return the cursor coordinates x, y within the visible screen.

:param session_id: Target session UUID. Defaults to the active session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'get_cursor_position' tool. It resolves the session, gets screen contents, and returns the cursor coordinates (x, y) from the visible screen.
    async def get_cursor_position(session_id: str | None = None) -> str:
        """Return the cursor coordinates ``x``, ``y`` within the visible screen.
    
        :param session_id: Target session UUID. Defaults to the active session.
        """
        sess = await _session(session_id)
        contents = await sess.async_get_screen_contents()
        coord = contents.cursor_coord
        return f"x={coord.x} y={coord.y}"
  • The '@mcp.tool()' decorator registers 'get_cursor_position' as an MCP tool.
    @mcp.tool()
    async def get_cursor_position(session_id: str | None = None) -> str:
Behavior2/5

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

No annotations are present, so the description carries full burden. It mentions returning coordinates and default session, but does not disclose whether it is read-only, required permissions, error conditions, or side effects.

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?

Two sentences, front-loaded purpose, no redundant information. The parameter doc is integrated nicely.

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

Completeness4/5

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

Given the tool's simplicity (1 optional param, output schema exists), the description is fairly complete. It covers purpose and the only parameter. Minor gap: could mention return format, but output schema likely covers that.

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

Parameters4/5

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

Schema description coverage is 0%, but the description includes a docstring for the parameter ('Target session UUID. Defaults to the active session.'), which adds meaning beyond the schema's type definition.

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

Purpose5/5

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

Clearly states it returns cursor coordinates x,y within the visible screen. The verb 'Return' and resource 'cursor coordinates' are specific and distinguish it from siblings like 'run_command' or 'read_screen'.

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 on when to use this tool vs alternatives. It does not mention when not to use or provide any context about prerequisites or limitations.

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/lorencarvalho/iterm2-mcp'

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