Skip to main content
Glama

Open a WSL session

wsl_connect

Open a session in the configured WSL distro and return its session ID, preserving the working directory across subsequent shell commands. Close it when done.

Instructions

Open a session in the configured distro and return its session id. A session remembers the working directory, so a 'cd' in one wsl_exec still applies to the next. Each command is still its own process — nothing else (environment variables, background jobs) persists between calls. Close it with wsl_disconnect when done; idle sessions are forgotten automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute directory to start in, with no shell metacharacters. Defaults to WSL_CWD, else the login shell's directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare non-read-only, open-world, non-idempotent. The description adds genuine beyond-annotation detail: cwd persistence across calls, but no persistence of environment variables or background jobs, and automatic forgetting of idle sessions. It doesn't cover authorization/permission requirements or what happens when no distro is configured.

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?

Four tight sentences: purpose and return value first, then the persistence model, then cleanup. Nothing is repeated and every clause conveys distinct information.

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?

With one optional parameter, no output schema, and annotations covering the safety profile, the description is nearly complete: it names the return value and the session semantics. The remaining gap is failure behavior when no distro is configured or the config is missing.

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?

Schema coverage is 100% and the single cwd parameter is fully documented in the schema, including its default chain (WSL_CWD, else login shell directory). The description adds no additional syntax or format guidance for cwd, so the baseline 3 applies.

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 a precise verb+resource ('open a session in the configured distro') and the concrete result ('return its session id'). It is clearly distinguishable from wsl_disconnect, wsl_list_sessions, and wsl_exec, which it explicitly references.

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?

Explicitly covers the lifecycle: use wsl_disconnect when finished, and idle sessions are reclaimed automatically, which tells the agent it need not aggressively clean up. It implies this must precede wsl_exec but never states that as an explicit precondition or names wsl_exec as the follow-up tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.