Skip to main content
Glama

uma_filter

Reduce retrieved context to relevant sentences for a query. Uses a cross-encoder to score sentence relevance, keeps those above a threshold, and returns trimmed context with metrics.

Instructions

Filter retrieved context down to sentences relevant to a query.

Runs sentence segmentation, then a local cross-encoder (cross-encoder/ms-marco-MiniLM-L-6-v2 by default) to score every sentence's relevance to the query, keeps sentences scoring at or above threshold (0-1, default 0.5), optionally trims to max_tokens, and returns the filtered context along with real measured metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
contextYes
thresholdNo
max_tokensNo
Behavior4/5

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

With no annotations, the description carries the full burden and does well by disclosing the underlying mechanism (sentence segmentation, cross-encoder model), the threshold semantics (score at or above), optional max_tokens trimming, and the return of 'real measured metrics'. It does not specify which exact metrics are returned, but overall it is transparent about its behavior.

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?

The description is a compact two-sentence structure, with the first sentence front-loading the core purpose and the second detailing the algorithm. It is dense but every clause adds necessary information; no redundancy or fluff.

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?

The description explains the return value ('filtered context along with real measured metrics') at a high level, which is essential given no output schema. However, it does not detail the structure of the metrics or edge cases (e.g., empty context), leaving some ambiguity for a moderate-complexity tool.

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 description coverage is 0%, so the description is the only source of parameter meaning. It clearly explains threshold (score at or above, default 0.5) and max_tokens (trims to), while query and context are self-explanatory. This compensates well for the schema gap.

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?

Description uses a specific verb ('Filter') and resource ('retrieved context down to sentences relevant to a query'), making its purpose clear. It does not explicitly distinguish from sibling tools (uma_score, uma_stats), though the process description (sentence segmentation, relevance scoring) makes the filtering role evident.

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

Usage Guidelines3/5

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

The description implies usage when you have retrieved context and want to filter by relevance, but it does not provide explicit when-to-use/when-not-to-use guidance or mention alternatives. No exclusions or sibling comparisons are given, so the usage context is only implied.

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/sainellutla/uma'

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