Skip to main content
Glama

get_user_context

Retrieve tiered cold-start user context—identity, work preferences, quality standards, and past decisions—to personalize new conversations with controlled latency.

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
levelNostandard
user_promptNo
token_budgetNo
project_folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses behavior: quick tier is pure JSON reads (low latency), standard adds quality/domains/lessons, full includes conflict detection and auto-sync side effects. It also notes that standard skips expensive reconciliation.

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 bilingual text, bullet points, and clear sections. It is slightly lengthy but every sentence adds value; could trim some repetition but overall effective.

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?

Given the four parameters, no annotations, and the presence of an output schema, the description covers all necessary aspects: purpose, usage context, parameter details, tier behavior, and side effects. It is complete for an AI agent to correctly select and invoke the tool.

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 coverage is 0%, but the description explains all four parameters in detail: project_folder (optional), level (tiers and defaults), token_budget (priority-based clipping), and user_prompt (playbook matching). This adds significant meaning beyond the bare 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?

The description clearly states the tool retrieves user context at conversation start, with three tiers (quick/standard/full) each detailed. It distinguishes from sibling tools like get_identity_card or get_project_context by specifying it provides comprehensive context including preferences, quality, lessons, etc.

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 explicitly says to call at the start of each conversation and notes the standard tier suffices for most cases, with full tier reserved for explicit user requests. However, it does not directly compare with sibling tools or state when to use them instead.

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