Skip to main content
Glama

rename

Change your instance ID in the Claude IPC MCP server by providing your current and desired new identifiers, with a rate limit of one change per hour.

Instructions

Rename your instance ID (rate limited to once per hour)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
old_idYesYour current instance ID
new_idYesThe new instance ID you want

Implementation Reference

  • Core implementation of the rename action in the MessageBroker's _process_request method. Handles validation, queue migration, instance update, forwarding setup, rate limiting, session updates, and broadcasts a notification to other instances.
    elif action == "rename":
        # Get validated instance_id from session
        old_id = request.get("old_id")  # This will be overridden by session validation
        new_id = request["new_id"]
        
        # Validate new_id format
        if not self._validate_instance_id(new_id):
            return {"status": "error", "message": "Invalid new instance ID format"}
        
        # The old_id should match the session's instance_id (enforced by _process_request)
        # Check if old instance exists
        if old_id not in self.instances:
            return {"status": "error", "message": f"Instance {old_id} not found"}
        if new_id in self.instances:
            return {"status": "error", "message": f"Instance {new_id} already exists"}
        
        # Check rate limit (1 hour)
        now = datetime.now()
        if old_id in self.last_rename:
            time_since_last = (now - self.last_rename[old_id]).total_seconds()
            if time_since_last < 3600:  # 1 hour in seconds
                minutes_left = int((3600 - time_since_last) / 60)
                return {"status": "error", "message": f"Rate limit: can rename again in {minutes_left} minutes"}
        
        # Move the queue
        if old_id in self.queues:
            self.queues[new_id] = self.queues.pop(old_id)
        else:
            self.queues[new_id] = []
        
        # Update instance record
        self.instances[new_id] = self.instances.pop(old_id)
        
        # Set up name forwarding
        self.name_history[old_id] = (new_id, now)
        
        # Update rate limit tracking
        self.last_rename[new_id] = now
        if old_id in self.last_rename:
            del self.last_rename[old_id]
        
        # Update session mapping
        if old_id in self.instance_sessions:
            session_token = self.instance_sessions.pop(old_id)
            self.instance_sessions[new_id] = session_token
            # Update session info
            if session_token in self.sessions:
                self.sessions[session_token]["instance_id"] = new_id
        
        # Broadcast rename notification
        for instance_id in self.queues:
            if instance_id != new_id:
                notification = {
                    "from": "system",
                    "to": instance_id,
                    "timestamp": now.isoformat(),
                    "message": {"content": f"📝 {old_id} renamed to {new_id}"}
                }
                self.queues[instance_id].append(notification)
        
        return {"status": "ok", "message": f"Renamed {old_id} to {new_id}"}
  • MCP tool handler for the 'rename' tool in call_tool(). Forwards the rename request to the MessageBroker via BrokerClient and updates the local current_instance_id if successful.
    elif name == "rename":
        if not current_session_token:
            return [TextContent(type="text", text="Error: Not registered. Please register first.")]
            
        response = BrokerClient.send_request({
            "action": "rename",
            "old_id": arguments["old_id"],
            "new_id": arguments["new_id"],
            "session_token": current_session_token
        })
        
        # Update stored instance_id if rename succeeded
        if response.get("status") == "ok":
            current_instance_id = arguments["new_id"]
            
        return [TextContent(type="text", text=json.dumps(response, indent=2))]
  • Registration of the 'rename' tool in @app.list_tools(), including its name, description, and input schema.
    Tool(
        name="rename",
        description="Rename your instance ID (rate limited to once per hour)",
        inputSchema={
            "type": "object",
            "properties": {
                "old_id": {
                    "type": "string",
                    "description": "Your current instance ID"
                },
                "new_id": {
                    "type": "string",
                    "description": "The new instance ID you want"
                }
            },
            "required": ["old_id", "new_id"]
        }
    ),
  • Input schema definition for the 'rename' tool, specifying parameters old_id and new_id.
    inputSchema={
        "type": "object",
        "properties": {
            "old_id": {
                "type": "string",
                "description": "Your current instance ID"
            },
            "new_id": {
                "type": "string",
                "description": "The new instance ID you want"
            }
        },
        "required": ["old_id", "new_id"]
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively adds context by specifying the rate limit ('once per hour'), which is a crucial behavioral trait not inferable from the input schema. However, it doesn't cover other aspects like permissions needed, whether the rename is reversible, or what happens on success/failure, leaving some gaps.

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 a single, efficient sentence that front-loads the key information ('Rename your instance ID') and adds a critical constraint ('rate limited to once per hour') without any wasted words. Every part of the sentence earns its place, making it highly concise and well-structured.

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's complexity (a mutation with no annotations and no output schema), the description is partially complete. It covers the core action and a rate limit but lacks details on prerequisites, error handling, or return values. For a tool that modifies an instance ID, more context on permissions or side effects would be beneficial, making it adequate but with clear gaps.

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

Parameters3/5

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

The input schema has 100% description coverage, with clear documentation for 'old_id' and 'new_id'. The description adds no additional meaning beyond what the schema provides, such as format constraints or examples. Given the high schema coverage, a baseline score of 3 is appropriate as the schema does the heavy lifting.

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 ('Rename') and the resource ('your instance ID'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'register' or 'list_instances', but the specificity of renaming an instance ID is sufficient for clarity without being tautological.

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?

The description provides no guidance on when to use this tool versus alternatives like 'register' (which might create a new instance) or other siblings. It mentions a rate limit, but this is more about behavioral constraints rather than usage context, leaving the agent with no explicit when/when-not instructions.

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/jdez427/claude-ipc-mcp'

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