Skip to main content
Glama

session_set_active

Idempotent

Set or clear the active session for a provider to define where requests without a session ID go. Clear it to force explicit session selection.

Instructions

Set or clear the active session for a provider; the active session is used when a request omits sessionId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cliYesProvider type (claude|codex|gemini|grok|mistral|devin|cursor|grok-api)
sessionIdYesSession ID (null to clear)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv3.2.0
  2. Removedv3.0.0
  3. First observedv2.16.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already indicate idempotent and non-destructive mutation. The description adds the key behavioral fact that this session becomes the default for requests omitting sessionId, which goes beyond what annotations convey. No contradictions exist.

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, well-structured sentence that front-loads the action and follows with the critical usage context. No wasted words.

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?

This is a simple two-parameter tool with full schema coverage and clear annotations. The description explains the operation and its effect well enough for an agent to invoke it correctly without an output schema.

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 description coverage is 100% and both parameters have descriptive text, including 'null to clear' for sessionId. The description adds little beyond the schema but does not need to, since the schema fully documents parameter meaning.

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 names a specific action ('Set or clear'), a specific resource ('active session for a provider'), and defines what 'active' means. This clearly differentiates it from sibling session tools like session_create, session_delete, and session_clear_all.

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?

The description gives clear context: the active session is the default used when a request omits sessionId. It does not explicitly name alternatives or exclusions, but the usage context is sufficient for an agent to decide when this tool is relevant.

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

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/verivus-oss/llm-cli-gateway'

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