Skip to main content
Glama

set_badge

Display custom translucent text on an iTerm2 session badge for easy identification.

Instructions

Set the iTerm2 session badge (translucent overlay text).

The profile's Badge field must reference \(user.badge) for the value to show up; this is the default in stock profiles.

:param badge: Text to display as the badge. :param session_id: Target session UUID. Defaults to the active session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
badgeYes
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler for the 'set_badge' tool. Resolves the target session, then sets 'user.badge' via iTerm2's async_set_variable API.
    @mcp.tool()
    async def set_badge(badge: str, session_id: str | None = None) -> str:
        """Set the iTerm2 session badge (translucent overlay text).
    
        The profile's Badge field must reference ``\\(user.badge)`` for the value
        to show up; this is the default in stock profiles.
    
        :param badge: Text to display as the badge.
        :param session_id: Target session UUID. Defaults to the active session.
        """
        sess = await _session(session_id)
        await sess.async_set_variable("user.badge", badge)
        return f"Set badge on session {sess.session_id} to {badge!r}"
  • Registration of set_badge as an MCP tool via the @mcp.tool() decorator. The FastMCP instance 'mcp' is created on line 21.
    @mcp.tool()
Behavior3/5

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

No annotations are provided, so the description must convey behavioral details. It discloses the prerequisite about the profile's Badge field and the default session behavior, but does not describe side effects like overwriting previous badges or error conditions.

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?

The description is concise with two short paragraphs plus parameter docstrings. The first sentence front-loads the purpose. However, the param docstring format adds minor redundancy.

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?

The tool has an output schema but the description does not explain return values. It does provide important setup context (profile interpolation). Missing details on failure modes or cancellation are gaps.

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?

The input schema has 0% description coverage, so the description adds value. For badge it clarifies 'Text to display as the badge.' For session_id it explains 'Target session UUID. Defaults to the active session.' This goes beyond the schema's type-only definitions.

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?

The description clearly states 'Set the iTerm2 session badge (translucent overlay text)' and explains the prerequisite about the profile's Badge field referencing \(user.badge). This provides a specific verb and resource, distinguishing it from other session-related sibling tools.

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 explicit guidance on when to use this tool versus alternatives like set_session_name or focus_session. Does not mention when not to use it.

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