Skip to main content
Glama

Semantic search

semantic_search
Read-onlyIdempotent

Rank free-text health records by relevance using keyword search across notes, events, and clinical details. Returns best matches first with source references and highlighted snippets.

Instructions

Relevance-ranked full-text search across all free-text health history.

Unlike search_records (exact case-insensitive substring), this builds a transient SQLite FTS5 index over every free-text field — notes, event details, encounter reasons/assessments/plans, lab flags, imaging findings, document text, care-task notes, and more — stems terms, and ranks hits by BM25. So the model can query history by meaning/keywords instead of an exact key and gets the best matches first. This is lexical ranking (local, no embeddings or network), not vector semantics.

Every hit carries source_table + record_id (feed them to get_record to pull the exact row) and a highlighted snippet, so findings can be grounded in a row.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNowhich person; defaults to the primary user.
limitNomax hits to return (ranked best-first).
queryYesfree-text query; terms are OR-ed with prefix + stemming for recall.
tablesNooptional comma-separated subset of tables to search.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint as true, so the description builds on these with rich behavioral details: transient SQLite FTS5 indexing, stemming, BM25 ranking, lexical vs. vector semantics, and output structure (source_table, record_id, highlighted snippet). No contradiction.

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 well-structured with a clear first sentence stating purpose, followed by comparison, technical details, and output explanation. Every sentence adds value; no redundancy or fluff.

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 the presence of an output schema, the description appropriately focuses on behavioral and usage details. It covers search scope, ranking mechanism, and output content (source_table, record_id, highlighted snippet) with grounding advice. This is complete for a search tool with 4 params and high schema coverage.

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 meaning beyond the schema by explaining that query terms are OR-ed with prefix and stemming, and that limit returns best-first. It also contextualizes tables as a subset of full-text fields. This elevates the score above baseline.

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 states 'Relevance-ranked full-text search across all free-text health history' with a specific verb and resource. It explicitly distinguishes itself from the sibling tool 'search_records' by contrasting its behavior (exact substring) with semantic search's FTS5 indexing and BM25 ranking, thereby providing clear differentiation.

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 explicitly contrasts with search_records, telling when to use this tool instead. It says 'Unlike search_records (exact case-insensitive substring), this builds...' and explains that it allows querying by meaning/keywords. While it lacks explicit when-not-to-use scenarios, the comparison provides strong guidance.

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/Cole-Will-I-Am/HealthLedger-MCP'

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