Skip to main content
Glama
Koderkup

mcp-context-optimizer

search_context

Retrieve query-relevant context fragments ranked by an explainable relevance model, returning score breakdowns and provenance without altering sources.

Instructions

Retrieve fragments relevant to a query, ranked by the explainable relevance model. Returns fragments with score breakdowns and provenance (never modifies sources).

Input Schema

NameRequiredDescriptionDefault
limitNoMax fragments to return (default 10).
queryYesNatural-language query or task description.
recordsNoOptional records to search inline, in addition to stored records.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.9

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does meaningful work: it explicitly guarantees the operation never modifies sources (a read-only safety claim) and discloses that results carry score breakdowns and provenance. It stops short of describing the scope of stored records searched, freshness, or result-count behavior beyond what the schema's limit field already states.

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, no filler, with the core action and the strongest behavioral guarantee ("never modifies sources") front-loaded. Every clause adds information an agent can act on.

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?

For a three-parameter read tool with no output schema, the definition covers action, ranking model, return contents, and safety. The remaining gap is routing: an agent given five retrieval-oriented siblings lacks the sentence that would tell it when this is the right choice.

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 description coverage is 100%, so query, limit, and the inline `records` array are already documented in structured form. The description adds nothing about parameter interaction — notably that `records` supplements rather than replaces stored records, which the schema only hints at — so it stays at the baseline.

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?

Names a specific verb and resource ("Retrieve fragments relevant to a query") and adds the distinguishing trait that results are ranked by an explainable relevance model. It does not, however, contrast itself with the retrieval siblings (get_decisions, get_relevant_errors, build_context), so an agent must infer that this is the generic cross-kind search.

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?

Usage is only implied: the phrasing suggests a free-form relevance search over stored context, in contrast to the more targeted sibling lookups. There is no explicit when-to-use statement, no condition favoring this over build_context, and no guidance on when the inline `records` mode is appropriate.

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