Skip to main content
Glama

get_rag_context

Retrieve relevant text chunks from a soul memory workspace and format them into a structured context block to prepend to system prompts, enabling grounded responses for prompt injection prevention.

Instructions

Build a grounded context block from soul memory for prompt injection.

Retrieves relevant chunks and formats them as a structured context block that can be prepended to the system prompt for grounded responses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe user's question or topic to ground against.
workspace_pathNoPath to soul workspace. Defaults to current workspace.
max_tokensNoMaximum approximate tokens for the context block.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the retrieval and formatting process but does not disclose any behavioral traits such as authentication requirements, rate limits, or what happens with incomplete queries. It is minimally sufficient but could be more transparent.

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?

The description is concise and effective: two sentences with no wasted words. The first sentence captures the core purpose, and the second adds necessary detail about the output format. Well-structured for quick understanding.

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 the existence of an output schema, the description need not detail return values. However, it covers the essential purpose and behavior for a grounded context retrieval tool. It could benefit from mentioning that the output is specifically formatted for system prompt injection, which it does. Overall, it is complete for the tool's complexity.

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 coverage is 100%, so parameters are well-documented in the schema. The description does not add any additional meaning beyond the parameter descriptions, which already explain the query, workspace path, and max tokens. A baseline score of 3 is appropriate.

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 it builds a grounded context block from soul memory for prompt injection, specifying both the action and the resource. It also implicitly distinguishes from siblings like search_soul_memory or memory_recall by focusing on formatting for prompt injection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for obtaining a grounded context block to prepend to a system prompt, but does not explicitly state when to avoid it or mention alternative tools. Given the sibling list, some guidance on when to use this over search_soul_memory would improve clarity.

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/sailorpepe/undesirables-mcp-server'

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