Skip to main content
Glama

cortex_query_memory

Retrieve relevant code context from a hybrid memory engine. Query returns synthesized, concise context to reduce token usage and prevent amnesia.

Instructions

Hybrid 4-tier retrieval returning synthesized, lean context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
max_tokensNo
session_idNo
target_entityNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.6/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral disclosure burden. The phrase 'returning synthesized, lean context' does disclose that results are not raw and are intentionally summarized, which is useful. However, the '4-tier retrieval' behavior is unexplained, and no constraints such as freshness, fallback behavior, or side effects are disclosed.

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 description is a single sentence and easy to scan, but it is not optimally concise because the phrase 'Hybrid 3-tier retrieval returning synthesized, lean context' contains unexplained jargon. It is small but not every piece of phrasing earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a minimal one-liner for a tool with four parameters, no annotations, and no parameter semantics. It lacks usage guidance, alternative routing, and parameter clarification, making it substantially incomplete for an agent to invoke it correctly in varied contexts. The presence of an output schema helps only with return-shape expectations, not with selecting parameters or understanding behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not compensate at all. It never mentions query, max_tokens, session_id, or target_entity, leaving the agent without any semantic guidance for four parameters beyond their raw names and types.

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 clearly states that the tool performs retrieval over memory and returns synthesized context. It is not a tautology and identifies the primary operation and resource, though the 'Hybrid 4-tier' phrasing adds jargon without explanation and does not explicitly distinguish it from sibling retrieval tools like cortex_inspect_graph.

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

Usage Guidelines2/5

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

There is no guidance about when to use this tool versus alternatives such as cortex_inspect_graph or cortex_check_error_loop. The description implies the tool is for querying memory, but it never states when to prefer it over siblings, what kinds of queries are appropriate, or when a different tool should be selected.

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