Skip to main content
Glama

get_user_context

Retrieve a user's identity, preferences, and past learnings at conversation start with latency control. Choose between quick, standard, or full context levels to balance speed and completeness.

Instructions

获取用户的个性化上下文(冷启动,分层延迟可控)。 / Get tiered cold-start user context with latency control.

**Lifecycle: startup** — 对话开始时调用,为 AI 注入用户身份和上下文。
Lifecycle: startup — call at conversation start to inject user identity and context.

用途:在每次新对话开始时调用,了解用户是谁、如何工作、学到了什么、质量标准是什么。
Purpose: Call at the start of each new conversation to understand who the user is, how they work, what they have learned, and their quality bar.

分层说明 / Tiered behaviour:
- "quick": 仅身份画像 + 工作偏好(纯 JSON 读取,无文件扫描,最低延迟)。
  Profile + preferences only — pure JSON reads, no filesystem scans. Lowest latency.
- "standard"(默认): 加上质量标准、经验领域、相关教训/决策、项目快照。跳过昂贵的 reconcile。
  Default. Adds quality, domains, top lessons/decisions, project snapshot. Skips expensive reconciliation.
- "full": 完整上下文,含冲突检测、过期/暂存提醒、自动同步副作用。仅在用户明确要求"全量回顾"时使用。
  Full context including conflict detection, stale/staging warnings, auto-sync side effects. Use only when the user explicitly asks for a comprehensive memory review.

注意:默认 "standard" 已覆盖绝大多数冷启动需求;只有用户问"我们之前所有决定/经验"或要做记忆健康检查时才用 "full"。
Note: "standard" covers most cold-start needs. Use "full" only when the user asks for a comprehensive memory review.

Args:
    project_folder: 当前项目文件夹路径(可选)。 / Current project folder path (optional).
    level: "quick" | "standard" | "full",默认 "standard"。 / Tier — defaults to "standard".
    token_budget: 上下文 token 预算(可选)。设定后按优先级裁剪 section,低优先级 section 先丢弃。不设则返回全量。
        Optional token budget. When set, sections are included by priority until budget is exhausted.
    user_prompt: 用户当前提问(可选)。传入后会追加到上下文末尾,并与已存 Playbook 的
        triggers 关键词匹配,命中时浮现「相关 Playbook」小节(标题 + ID;用 get_playbooks(mode="get") 查看完整步骤)。
        Optional current user prompt. Appended to the context and matched against stored
        playbook trigger keywords; hits surface a "Matched Playbooks" section (title + id;
        call get_playbooks(mode="get") for the full steps).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_folderNo
levelNostandard
token_budgetNo
user_promptNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries full behavioral burden. It discloses important traits: tiered behavior (quick: no filesystem scans, standard: skips expensive reconciliation, full: includes conflict detection and side effects), token budget prioritization, and playbook matching side effect. It does not explicitly state readOnly, but the read-only nature is implied by the 'cold-start' context retrieval. The description is transparent enough for an agent to understand side effects and behavior.

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 headings, bullet points, and bilingual text. It front-loads the core purpose and lifecycle. While the bilingual format adds some length, it does not contain filler—every sentence adds value. Slightly verbose due to repetition in both languages, but overall concise given the complexity.

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?

Given an output schema exists, the description is complete enough: it explains parameter usage, tier behavior, and side effects. It references a sibling tool for playbook retrieval, providing a complete picture. It does not describe the return format, but the output schema likely covers that. The description sufficiently addresses the tool's role in the memory ecosystem.

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?

With 0% schema coverage, the description adds extensive meaning to all four parameters. It explains the level enum with detailed tiered behavior, describes token_budget priority slicing, and elaborates on user_prompt playbook matching mechanism. This goes far beyond the bare schema and equips the agent to use parameters correctly.

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's purpose: retrieving tiered cold-start user context with latency control. It specifies the lifecycle ('startup') and explicitly distinguishes itself by focusing on user identity and context at conversation start. This is specific and helps differentiate from sibling tools like get_recent_context or get_recall.

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 provides clear when-to-use guidance: call at conversation start. It also advises against using 'full' level unless the user requests a comprehensive memory review, thus offering when-not-to-use guidance. However, it does not explicitly contrast with sibling tools, missing an opportunity to clarify when to prefer this tool over alternatives.

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/Patdolitse/piia-engram'

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