Skip to main content
Glama

calibrate_threshold

Auto-calibrate vector search threshold by sampling random memory pairs and setting threshold above the null cosine distribution mean, rejecting unrelated pairs. Uses percentile or zscore method.

Instructions

Auto-calibrate the vector search threshold from the null (random-pair) cosine distribution. Samples random memory pairs and places the threshold ABOVE the null mean so unrelated pairs are rejected. method='percentile' (default) uses a quantile of the null distribution (robust to anisotropic models such as bge-m3); method='zscore' uses mean + z*std. No labels used, purely statistical. Adapts to both embedding model and corpus characteristics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNo'percentile' (default), 'zscore', or 'separation' (two-population, learns the operating point from null vs nearest-neighbour positives)
agent_idYesAgent ID whose memories to sample
z_factorNoZ-score multiplier for method='zscore' (default: 1.0, higher = stricter)
percentileNoNull-distribution quantile for method='percentile' (default: 0.95, higher = stricter)
sample_sizeNoNumber of embeddings to sample (default: 200)
Behavior4/5

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

With no annotations provided, the description fully bears the burden of behavioral disclosure. It explains the statistical process (sampling random memory pairs, computing null distribution, placing threshold above the mean) and notes that no labels are used and it adapts to model/corpus. It does not mention specific side effects or permissions, but the behavior 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?

The description is concise (3-4 sentences) and well-structured, with the core purpose stated first, followed by method details and a closing note on adaptability. No redundant or irrelevant information.

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 5 parameters and no output schema. The description does not explain what the tool returns (e.g., the new threshold value). It mentions placing threshold above the null mean but lacks output details. The description of 'separation' method is brief. Overall, it provides good context but has a gap in output specification.

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 each parameter is already documented. The description adds context about the methods (`percentile` is default, `zscore` uses mean+z*std, `separation` is mentioned but not explained in schema), providing modest extra value. The description of the `method` parameter is enhanced, but overall the schema already covers basic semantics adequately.

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 clearly states the tool's purpose: to auto-calibrate the vector search threshold using the null distribution. It specifies the verb 'auto-calibrate' and the resource 'threshold', and distinguishes from sibling tools which are mainly CRUD and recall operations.

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 provides context on when to use the tool (for calibrating threshold) and explains the available methods (`percentile`, `zscore`, `separation`) with guidance (e.g., percentile is robust to anisotropic models). It does not explicitly mention when not to use alternatives, but the sibling tools are clearly different in purpose.

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/Cloto-dev/CPersona'

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