Skip to main content
Glama

get_recent_context

Read-onlyIdempotent

Recover previous AI conversation state after a tool restart or session disconnect. Reads recent context on demand without auto-loading it into new sessions.

Instructions

找回最近的 AI 对话上下文。 / Retrieve the most recent AI conversation context.

用途:上下文丢失时(工具重启、会话断开)调用,找回之前的工作状态。
Purpose: Call after context loss (tool restart, session disconnect) to recover previous work state.

不会自动加载到新会话 — 只在你需要时才读取。
Does NOT auto-load into new sessions — only reads when you ask.

Args:
    tool: 工具名(可选)。留空则搜索所有工具的上下文。 / Tool name (optional). Empty searches all tools.
    limit: 最多返回几个会话(默认 1 = 最近一次)。 / Max sessions to return (default 1 = most recent).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_recent_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
toolNo
limitNo
project_folderNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.13.0
    • addedInput schema / properties / project_folder
      Added value: +{
      +  "default": "",
      +  "title": "Project Folder",
      +  "type": "string"
      +}
  2. Addedv3.29.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so the safety profile is covered; the description adds genuinely new behavioral facts — that nothing is auto-injected into new sessions and that reads are on-demand only. It doesn't discuss result shape, but an output schema exists, so that omission is acceptable.

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

Conciseness3/5

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

The purpose and the 'does not auto-load' caveat are front-loaded and earn their place, but every sentence is duplicated in Chinese and English, roughly doubling length without adding information. The Args block is efficiently formatted, so the waste is redundancy rather than tangential content.

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?

With annotations covering safety, an output schema covering return values, and zero required parameters, the description does nearly all the remaining work: purpose, trigger, and the non-auto-load caveat are all present. The only shortfall is the undocumented 'project_folder' parameter.

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 description coverage is 0%, so the description must carry all three parameters; it explains 'tool' (empty = search all tools) and 'limit' (default 1 = most recent) with useful semantics. It says nothing about 'project_folder', leaving one of three parameters completely undefined — a real gap for an agent scoping a recovery query.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Retrieve the most recent AI conversation context') and frames the scope as conversation history rather than user, project, or knowledge state, which is what separates it from get_user_context / get_project_context / get_relevant_knowledge. It never names a sibling explicitly, so the differentiation is inferred rather than stated.

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 a concrete trigger ('Call after context loss — tool restart, session disconnect') and adds a negative rule ('Does NOT auto-load into new sessions — only reads when you ask'), which prevents the agent from assuming the context is already present. No alternative tool is named for the cases this one doesn't cover.

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