Skip to main content
Glama

inject_context

Retrieve relevant observations from past sessions mid-task to refresh context without restarting. Query by topic or let session focus guide results.

Instructions

Auto-inject relevant context from past sessions at any point during work.

AUTOMATIC TRIGGERS - Call this when:

  • You need a refresher on past work mid-session

  • Starting work on a new subtask and want relevant context

  • User asks "what have we learned about X previously?"

Retrieves up to 50 relevant observations from previous sessions. Unlike session_start (which auto-injects), you can call this mid-session.

WORKFLOW POSITION: Call anytime you need past context, not just at session start.

PARAMETERS:

  • session_id: Current session ID

  • query: What you want context about (optional - uses session focus if not provided)

  • limit: Max observations to inject (default: 50)

  • user_id: Optional user/agent identifier used to isolate memory context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
queryNo
user_idNo
session_idYes
Behavior4/5

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

With no annotations, the description carries the full transparency burden. It discloses that up to 50 observations are retrieved, that query is optional and falls back to session focus, and that the call can happen mid-session. It does not detail potential side effects such as context-window consumption or whether repeated injections stack, which prevents a 5.

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 well-structured with clear sections for triggers, workflow position, and parameters, with the core purpose front-loaded. There is slight redundancy between the triggers and workflow-position lines, but no meaningless 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?

The description covers purpose, triggers, parameter semantics, and retrieval behavior sufficiently despite having no output schema or annotations. It could more thoroughly differentiate from other retrieval-related siblings such as search_knowledge or retrieve_context, but the essential call path is complete.

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%, but the description's PARAMETERS section adds meaningful semantics for all four parameters: session_id identity, query's optionality and fallback behavior, limit's default, and user_id's isolation purpose. This fully compensates for the schema gap.

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 auto-injects relevant context from past sessions at any point during work. It explicitly contrasts with session_start, making the tool's mid-session purpose unmistakable and differentiating it from a key sibling.

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 provides explicit automatic trigger conditions: needing a refresher, starting a new subtask, or being asked about prior learnings. It also notes that unlike session_start, inject_context can be called mid-session, giving clear usage guidance relative to an alternative.

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/Vedant9500/OpenLMlib'

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