Skip to main content
Glama

Get Session Info

get_session_info
Read-only

Check the current MCP session state before writes to confirm the active branch and Infrahub instance address.

Instructions

Return the current MCP session state — call before writes to know which branch they target.

Reports the active session branch (if any) and the Infrahub instance address. A session branch is lazily auto-created on the first write tool call (node_upsert / node_delete / mutate_graphql) and is named mcp/session-YYYYMMDD-<hex>. Before that first write, session_branch is None and all read tools target the default branch.

Typical uses:

  • Confirm which branch a proposed change would merge from.

  • Decide whether a write is about to open a new session branch.

  • Display the active branch to the user.

Returns: Dict with session_branch (str or null), infrahub_address, and has_session_branch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. First observedv1.1.5

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true; the description goes well beyond that by disclosing lazy session-branch auto-creation on the first write, the exact branch naming pattern (mcp/session-YYYYMMDD-<hex>), and the pre-write state where session_branch is None and reads target the default branch.

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?

Front-loaded with the key action and precondition, then a Returns block; every sentence earns its place, but there is mild redundancy between the prose paragraph and the bullet list restating when the session branch is vs. isn't active.

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?

No output schema exists, and the description compensates by naming the three returned keys (session_branch, infrahub_address, has_session_branch) and explaining their possible values. An agent has everything needed to call it and interpret the result.

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?

The tool takes no parameters, so the baseline is high; the description correctly supplies no parameter discussion. The 'Returns:' block shifts useful semantics to the result, though that is not a parameter concern.

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 specific verb and resource (return the current MCP session state) and immediately scopes it against the write tools that trigger branch creation. It is clearly distinguishable from siblings like reset_session_branch, which mutates that same state.

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?

Gives an explicit precondition ('call before writes to know which branch they target') plus a bulleted list of concrete use cases, and explains the lazy-creation timing that determines when the answer matters. Nothing is left to inference.

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