Skip to main content
Glama

Reuse active session or create one

post_sessions_get_or_create

Verifies Firebase ID token. If an active session already exists for (workspaceName, Firebase UID, app_id), returns a new sessionToken JWT for the most recently created matching row (touches activity; does not create a duplicate session). The request payload is ignored on reuse — it is applied only when a new session row is created. Prefer a dedicated app_id per integration surface, or revoke old sessions, if you need a fresh payload.

Otherwise behaves like POST /sessions (new row + default 1 hour TTL).

If the Firebase token includes email, the server best-effort persists or backfills it on the workspace end-user row (including when reusing an existing session). Intended for integrators that mirror hosted login session reuse.

Source: POST /api/v1/sessions/get-or-create Requires auth.firebaseToken and forwards it as a Bearer token. Prefer connection.workspaceName and connection.appId as stable config instead of generating identity fields dynamically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authNo
bodyYes
queryNo
paramsNo
connectionYes

Schema Changelog

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

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses that the tool touches activity, does not create duplicates, uses a default 1-hour TTL, forwards the Firebase token as a Bearer token, and best-effort persists email. These are critical behavioral details that an agent needs to invoke correctly.

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 dense but every sentence contributes new information: reuse key, payload behavior, defaults, auth, and configuration guidance. It is front-loaded with the core behavior and then adds necessary details. No filler or redundancy.

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?

Given the complexity (reuse-vs-create, side effects, auth, defaults), the description is complete. It explains the return value (sessionToken JWT), behavior on reuse, the default TTL, and the auth requirement. There is nothing essential missing for correct invocation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It explains the meaning and role of workspaceName, app_id, and payload (including that payload is stored as {} if null, and that app_id is per-app policy). It also clarifies that connection.workspaceName and connection.appId serve as stable defaults. This provides comprehensive meaning for all parameters beyond the schema.

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 the tool verifies a Firebase ID token and either reuses an active session or creates a new one. It defines the exact key (workspaceName, Firebase UID, app_id), the reuse behavior, and differentiates itself from POST /sessions. The purpose is unambiguous and specific.

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

Usage Guidelines5/5

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

The description explicitly explains when payload is ignored (on reuse) and when it applies (new session), and provides guidance to use a dedicated app_id or revoke sessions when a fresh payload is needed. It also advises on stable config (connection.workspaceName, connection.appId). This gives clear when-to-use and when-not-to-use direction beyond the schema.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation4/5

Most tools target distinct session/auth operations, and the descriptions clearly separate browser redirects from API endpoints. The main ambiguity is between get_sessions and get_sessions_my (payload vs. list) and the two logout variants, though the docs disambiguate them.

Naming Consistency4/5

API tools consistently use snake_case `{method}_{resource}_{action}` names, but a few deviate: `auth_session_callback` lacks the method prefix, `get_sessions_get_key`/`delete_sessions_delete_key` are redundant, and the `secureflows_*` helpers use a different prefix. Still readable and predictable.

Tool Count4/5

18 tools is slightly above the sweet spot, but the count is justified by distinct session lifecycle operations, auth redirects, and integration helpers. Only `get_docs_search` feels peripheral to the core session domain.

Completeness5/5

The surface covers session create, get-or-create, read, key-level update/delete, renew, revoke, logout, identity, and self-service listing/revocation, plus login/logout URL builders and linting. No important dead ends for the stated auth/session purpose.