Skip to main content
Glama
smara-io
by smara-io

Get User Context

get_user_context

Retrieve ranked user memories for LLM prompts, focusing on recent or query-specific context with optional team inclusion.

Instructions

Retrieve a pre-formatted context string for a user, ready to inject into an LLM system prompt. Ranked by Temporal Memory Scoring. Can be called without a query to get the most important recent memories. When a team is configured, includes team memories automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesUser to get context for
qNoOptional query to focus the context on a topic
top_nNoNumber of top memories to include
namespaceNoMemory namespace (default: from env or 'default')
team_idNoTeam ID to include team context from. Defaults to SMARA_TEAM_ID env var.
include_teamNoInclude team memories in context. Defaults to true when a team is configured.
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: the ranking method ('Ranked by Temporal Memory Scoring'), the optional query behavior, team memory inclusion logic, and the formatted output purpose. It doesn't mention rate limits, authentication needs, or error conditions, but provides substantial operational context.

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 sentences with zero waste - each sentence adds important information about functionality, usage patterns, and team behavior. The description is appropriately sized and front-loaded with the core purpose.

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 6-parameter tool with no annotations and no output schema, the description provides good context about what the tool does and how to use it. It explains the formatted output purpose and team memory behavior. However, it doesn't describe the return format or structure, which would be helpful given the lack of output schema.

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 100%, so the baseline is 3. The description adds some value by explaining the query parameter's purpose ('to focus the context on a topic') and team inclusion behavior, but doesn't provide additional semantic context beyond what the schema already documents for most parameters.

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 specific action ('retrieve a pre-formatted context string'), resource ('for a user'), and purpose ('ready to inject into an LLM system prompt'). It distinguishes from siblings like list_memories or search_memories by focusing on formatted context retrieval rather than raw memory operations.

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 context for usage ('Can be called without a query to get the most important recent memories') and mentions team configuration behavior. However, it doesn't explicitly state when to use this tool versus alternatives like search_memories or list_memories, which could help differentiate more clearly.

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/smara-io/mcp-server'

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