Skip to main content
Glama

get_session_info

Read-only

Check the active MCP session branch and Infrahub instance address to confirm which branch writes will target before making changes.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description fully discloses the read-only nature (matches readOnlyHint=true) and elaborates on the lazy creation of session branches, including the naming pattern and behavior before first write. This goes well beyond the annotation.

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 well-structured: a clear one-sentence purpose, followed by detailed behavior, typical uses, and a return specification. Every sentence adds value without extraneous text.

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?

The tool is simple (0 params, read-only) and the description covers all relevant aspects: purpose, behavior with/without session, return fields. It has an output schema but the description already lists the key names, making it fully self-contained.

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 input schema has no parameters (0 params), so schema coverage is 100% trivially. The description adds no parameter info because none are needed. Baseline for 0 params is 4.

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 tool name 'get_session_info' is self-descriptive. The description states it returns the current MCP session state, explicitly mentioning the branch and instance address. It clearly distinguishes from sibling tools (which focus on nodes, schema, mutations) by being the only session-related tool.

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 advises calling before writes to know which branch they target, and explains when session_branch is None vs. set. It gives typical use cases. Although it does not explicitly list when not to use it, the context is clear and no alternative tool serves the same purpose.

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

Install Server

Other Tools

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/opsmill/infrahub-mcp'

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