Skip to main content
Glama

query_layer

Read-onlyIdempotent

Query a specific memory layer with structured filters

Instructions

Query a specific memory layer with structured filters

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "layer": "<layer>"
    },
    "name": "query_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
layerYesMemory layer to query
optionsNoQuery options with structured filters

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.2.5
    • addedInput schema / properties / options / properties / history
      Added value: +{
      +  "description": "Return ended entries only, up to limit, so a page full of current entries cannot leave them out. Default false: ended entries follow the current ones until limit.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / options / properties / include_superseded / description
      Previous value: -"Whether entries replaced by a later revision are returned. DEFAULT TRUE since 2026-09-13: a superseded entry surfaces carrying superseded_by and is_superseded, so a revision is read in the context of what it replaced. Pass false for the live-only view. Expired entries are filtered either way - expiry and supersession are separate."New value: +"Accepted, and it does not hide anything. Superseded and expired entries are always returned, marked with their end date and what replaced them. Current entries are listed first."
    • changedInput schema / properties / options / properties / limit / description
      Previous value: -"Max results (1-1000, default: 20)"New value: +"Max results (1-1000, default: 10)"
    • changedInput schema / properties / options / properties / order_by / description
      Previous value: -"Sort field and direction, e.g. 'timestamp DESC' or 'importance ASC'. Fields: id, timestamp, importance, emotional_intensity, content, context. Anything else falls back to 'timestamp DESC'."New value: +"Sort field and direction, e.g. 'importance DESC' or 'timestamp DESC'. Fields: id, timestamp, importance, emotional_intensity, content, context. Default is importance descending. Current entries come first in every order, including timestamp. Anything else falls back to importance descending."
  2. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds nothing beyond that: no mention of result ordering, superseded/expired entry handling, or pagination semantics — all of which are behavioral facts an agent should not have to dig out of the schema.

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?

A single front-loaded sentence with no wasted words. It is efficient, though its brevity shades into under-specification rather than crispness given the tool's complexity.

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

Completeness3/5

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

The tool has a rich nested schema at full coverage, but no output schema and no sibling differentiation, so the agent lacks guidance on return shape and on choosing this over recall/semantic_recall. Adequate but with clear gaps for a query tool.

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 schema already documents layer, filters, ordering, history, and include_superseded thoroughly. The description adds no syntax or format detail beyond the schema, which is the expected baseline 3 when structured fields do the heavy lifting.

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?

States a specific verb and resource ('Query a specific memory layer') and adds scope ('with structured filters'), so the agent knows the operation. However, it does nothing to differentiate from closely related siblings such as recall, semantic_recall, or corpus_recall, which an agent must distinguish.

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?

No when-to-use guidance and no mention of alternatives, despite overlapping siblings (recall, semantic_recall, query_transcripts) that clearly invite confusion. The agent is left to infer that this tool is the layer-scoped filtered variant.

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