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

A4.7/5.0
Behavior5/5

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

With no annotations, the description fully carries the behavioral burden, and it delivers: it explains Firebase token verification and Bearer forwarding, reuse criteria, JWT return behavior, activity touch, payload-ignored-on-reuse semantics, default 1-hour TTL, and best-effort email backfill. No behavioral surprises are hidden.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is longer than average but every sentence adds a distinct piece of behavior: token verification, reuse semantics, payload handling, TTL, email backfill, endpoint, and configuration preference. Slight redundancy exists between the opening token verification and the later auth.firebaseToken requirement, but the structure is nonetheless efficient and front-loaded.

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?

For a tool with no annotations and no output schema, the description is remarkably complete: it covers the auth mechanism, request shaping, reuse vs. creation behavior, payload side effects, returned token, TTL, email persistence, and config best practices. An agent has enough context to invoke the tool correctly and predict its side effects.

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?

Although schema description coverage is 0%, the description adds essential meaning beyond the schema: auth.firebaseToken becomes a Bearer token, body.payload is only applied on new rows, body.app_id is tied to per-app policy and fresh-payload behavior, and connection.workspaceName/appId are recommended stable defaults. This compensates well for the schema-only gaps.

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 operation with a clear conditional: verify Firebase token, reuse the most recently created active session for the given key, or fall back to creating a new session like POST /sessions. This distinguishes it from plain session creation and renewal tools in the sibling list.

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?

It gives concrete guidance on when the tool is appropriate and when it is not: payload is ignored on reuse, so to get a fresh payload one should use a dedicated app_id or revoke old sessions. It also recommends stable connection.workspaceName and connection.appId config over dynamic identity fields, though it does not exhaustively compare against every sibling.

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

A3.7/5.0
Disambiguation2/5

Several tools cover nearly identical actions with subtle differences: post_sessions, post_sessions_get_or_create, and post_sessions_renew_session_token all create/reuse sessions; get_auth_logout and post_auth_logout both log out; and the two revoke endpoints overlap heavily. An agent would struggle to pick the correct variant without reading detailed descriptions.

Naming Consistency2/5

Naming mixes HTTP-verb prefixes (get_, post_, delete_) with domain-specific verbs (auth_session_callback, secureflows_build_login_url), and get_sessions_get_key is redundant and awkward. The pattern is inconsistent across the set even though individual chunks are readable.

Tool Count3/5

18 tools is on the heavy side for what is essentially session lifecycle management plus a few helper utilities. Many tools could be consolidated (e.g., one logout tool, one revoke tool, one key-access pattern), making the surface feel fragmented.

Completeness4/5

The session lifecycle is well covered: create, renew, revoke, logout, get payload, set/delete keys, identity, and self-service listing are all present. Minor gaps include no direct TTL adjustment after creation and no admin-level session management, but the core workflows are complete.