Skip to main content
Glama

haldir_create_session

Create a scoped session for an AI agent and receive a session_id for subsequent calls, with spend limits and permission scopes controlling secret and approval access.

Instructions

Create a scoped Haldir session for an AI agent. Returns a session_id the agent uses for every subsequent tool call. Use spend_limit to cap the agent's total spend; scopes (e.g. ['stripe:refund', 'postgres:read']) gate which secrets and approvals it can access.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>"
    },
    "name": "haldir_create_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
ttlNoSeconds until the session expires (default 3600)
scopesNoPermission scopes
agent_idYesHuman-readable agent identifier
spend_limitNoMax USD the session can spend (0 = no limit)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.3

TDQS

A3.8/5.0
Behavior3/5

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

No annotations exist, so the description carries full behavioral burden. It discloses the return value (session_id) and the gating behavior of scopes over secrets and approvals, which is useful. It omits permission requirements, what happens on expiry, or consequences of revoking, leaving meaningful gaps for a session-creation/mutation tool.

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?

Three tight sentences, front-loaded with purpose and return value, then parameter semantics. No repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a session-creation tool with no output schema and full schema coverage, the description covers purpose, return value, and the two semantically important parameters (spend_limit, scopes). It lacks explicit lifecycle guidance (when to create vs. reuse, expiry behavior), which a fully complete definition would add.

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 coverage is 100% and all four parameters already have descriptions, so the description cannot add much. It reinforces the role of spend_limit (capping total spend) and scopes (gating secrets/approvals) with example scope strings, adding some meaning, but ttl and agent_id are left to 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?

States a specific verb+resource ('Create a scoped Haldir session for an AI agent') and distinguishes itself from siblings like haldir_get_session or haldir_revoke_session by describing creation and its return value.

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

Usage Guidelines3/5

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

Implies usage context by explaining session_id is used for every subsequent call and by describing spend_limit and scopes semantics. It doesn't explicitly say when to create vs. reuse an existing session, or when to prefer alternatives, leaving sequencing guidance implicit.

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