Skip to main content
Glama

Context for a prompt

ragdown_context
Read-only

Retrieve relevant notes for a user prompt and inject them as a ready-to-inject context block. Filters by similarity score, skips short prompts, and avoids duplicate sections per session.

Instructions

For hooks that run before a turn: the notes related to a user prompt, as a ready-to-inject block, or empty text when nothing is similar enough. Unlike ragdown_recall it filters by min_score, skips short prompts and slash commands, and never returns a section twice for the same session_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_kNoDefault RAGDOWN_HOOK_TOP_K
promptYesThe user's prompt, verbatim
max_charsNoMost characters in the block. Default RAGDOWN_HOOK_MAX_CHARS
min_ratioNoLowest share of the best hit's similarity a hit may have and still be included; 0 keeps every hit above min_score. Default RAGDOWN_HOOK_MIN_RATIO
min_scoreNoLowest cosine similarity to include. Default RAGDOWN_HOOK_MIN_SCORE
session_idNoStable id of the conversation; sections already returned for it are skipped

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations provide readOnlyHint=true, openWorldHint=false, and the description aligns. It adds behavioral context beyond annotations: fails gracefully to empty text, filters by min_score, skips short prompts and slash commands, and prevents duplicate sections per session. Could mention empty return format but is largely 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?

Two sentences, densely informative. The main purpose is front-loaded, and the differentiation from ragdown_recall comes second. No filler or redundancy.

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 moderate complexity (6 params, no output schema), the description covers the key behavior: output is a block or empty, filtering logic, and deduplication. Could mention the return format in more detail (e.g., whether it's a plain string or includes metadata), but for a read-only retrieval tool, it is nearly complete.

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 already well-documented. The description adds high-level context (filtering, skipping) but doesn't add detail to any specific parameter beyond what schema provides (e.g., default env vars are in schema descriptions). Baseline 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?

Clearly states it returns a ready-to-inject <ragdown-context> block for pre-turn hooks, and explicitly contrasts with ragdown_recall. Distinguishes its filtering behavior (min_score, skips short prompts/slash commands, no duplicates per session).

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

Usage Guidelines5/5

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

Explicitly says 'For hooks that run before a turn', and mentions it is unlike ragdown_recall, suggesting when to use this vs. that sibling. Provides clear guidance on timing and alternative avoidance.

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