Skip to main content
Glama

reset_session

DestructiveIdempotent

Clear the current session for a workspace to start fresh with Gemini AI, removing previous context and interactions.

Instructions

Reset (clear) the ACP session for a workspace. The next gemini call for this workspace will create a fresh session. Pass workspace path, or omit to reset all sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNoWorkspace path to reset. Empty string resets all sessions.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `reset_session` tool handler function, which clears MCP sessions for a specific workspace or all workspaces.
    async def reset_session(
        workspace: Annotated[
            str,
            Field(description="Workspace path to reset. Empty string resets all sessions."),
        ] = "",
    ) -> Dict[str, Any]:
        """Reset session for a workspace or all sessions."""
        if workspace:
            removed = _bridge._sessions.pop(workspace, None)
            if not removed:
                # Try matching by suffix (user might pass partial path)
                matched = [k for k in _bridge._sessions if k.endswith(workspace)]
                if matched:
                    for k in matched:
                        _bridge._sessions.pop(k)
                    return {"reset": matched, "count": len(matched)}
                return {
                    "reset": [],
                    "count": 0,
                    "message": "No session found for workspace",
                }
            return {"reset": [workspace], "count": 1}
        else:
            count = len(_bridge._sessions)
            _bridge._sessions.clear()
            return {"reset": "all", "count": count}
Behavior4/5

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

Annotations declare destructive=true, idempotent=true, readOnly=false. Description valuably adds the session lifecycle context (clearing now creates fresh session on next gemini call) and explains the workspace-scoping vs global-scope behavior, which helps the agent understand the tool's side effects beyond the safety flags.

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?

Three sentences with zero waste: (1) Action definition, (2) Behavioral consequence linking to sibling, (3) Parameter instruction. Front-loaded with the core operation. Every sentence earns its place by conveying distinct essential information.

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

Completeness5/5

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

Appropriately complete for a low-complexity (1 param) destructive operation with 100% schema coverage, existing output schema, and rich annotations. Description covers scope, side effects, and parameter usage without needing to replicate return value documentation.

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 coverage is 100%, so fields are technically documented. Description adds semantic framing: 'or omit to reset all sessions' clarifies the empty string default behavior described in the schema, providing usage-oriented guidance that helps the agent understand the parameter's optional nature and global fallback behavior.

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?

States specific action 'Reset (clear)' with explicit resource 'ACP session' and scope 'workspace'. Critically references sibling tool 'gemini' ('The next gemini call...'), clarifying the tool's relationship to the session lifecycle and distinguishing it from list_sessions.

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

Usage Guidelines4/5

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

Provides clear usage context by explaining the deferred effect on subsequent 'gemini' calls and parameter behavior ('Pass workspace path, or omit to reset all sessions'). Lacks explicit 'when not to use' guidance or named alternatives, but the causal explanation implicitly guides selection.

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/shenyunhuan/gemini_mcp'

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