Skip to main content
Glama

lore_search

Find and retrieve memories using hybrid semantic and keyword search, or fetch specific lore entries by ID. Supports filtering by creation time, update time, source type, and scoring thresholds.

Instructions

Search memories by semantic + keyword query, or bulk-fetch by ID.

When ids is provided, skips the vector/BM25 pipeline entirely and does a direct SQL lookup by lore_id. query is ignored in that path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch text. Required unless ``ids`` is set.
limitNoMax results to return (default from settings).
min_scoreNoMinimum combined_score threshold (default 0.1).
include_linksNoAttach memory links to results (default True; forced off in ``format='title'`` mode since links add tokens with no gain).
include_deletedNoInclude soft-deleted memories (default False).
refine_fromNoRestrict search candidates to these lore_ids (configurable cap, default 200 via ``LORE_MAX_REFINE_FROM_IDS``).
formatNo``'full'`` (default) returns complete memory objects with relevance scores. ``'title'`` returns compact ``{id, title, score}`` dicts — lower token cost for listing before a targeted fetch.full
idsNoWhen set, returns these specific lore_ids directly from SQL, bypassing the search pipeline. Silently skips unknown IDs. Pair with ``format='title'`` for a two-step list-then-fetch workflow. Max 50 IDs (configurable via ``max_search_ids``).
created_afterNoISO 8601 UTC timestamp. Only return memories created on or after this time (e.g. ``'2026-06-04T00:00:00'``). UTC only; non-UTC offsets raise a validation error.
updated_afterNoISO 8601 UTC timestamp. Only return memories updated on or after this time. Composes with ``created_after`` and all other filters.
sort_byNo``'relevance'`` (default) ranks by hybrid score when the search pipeline runs. In ``ids`` lookup mode there is no scoring, so ``'relevance'`` preserves the caller-provided ``ids`` order instead. ``'recent'`` sorts by ``updated_at DESC``. ``'frequent'`` sorts by ``usage_count DESC``. Composes with timestamp filters.relevance
source_typeNoOptional provenance filter. When set, only return memories with this exact source_type. One of: ``observed``, ``inferred``, ``user_stated``, ``consolidated``, ``injected``, ``unknown``.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description discloses key behaviors: two pipeline modes, silent skipping of unknown IDs in ID lookup, effects of 'format' on token cost and 'include_links', interaction between 'refine_from' and ID cap, and sorting behavior differences. Missing explicit statement about read-only nature or authentication needs, but overall 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?

Highly efficient: a two-line summary upfront, then concise details about the ID path. Every sentence adds necessary information without redundancy. No filler.

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 12 parameters, 100% schema coverage, and an output schema, the description covers all key behavioral aspects: dual modes, parameter interactions, constraints (cap on IDs, UTC requirement), and formatting options. It is thorough and leaves no critical gaps for agent understanding.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by explaining inter-parameter dependencies (e.g., 'ids' ignores 'query', 'format=title' forces 'include_links=False'), constraints (max IDs for 'ids', UTC requirement for timestamps), and behavior variations ('sort_by' modes). This exceeds mere schema documentation.

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?

Clear verb ('search') and resource ('memories') with two distinct modes: semantic+keyword query and bulk-fetch by ID. The description distinguishes from sibling tools by specifying the types of retrieval operations, leaving no ambiguity about what the tool does.

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?

Provides explicit guidance on when to use the ID path versus the search path, including that 'query' is ignored in ID mode. However, it lacks direct comparison to siblings like 'lore_reflect' or 'lore_insert', relying on the context that this is a search/retrieval tool.

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/Jessinra/Lorekeeper'

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