Skip to main content
Glama

Search rulebook clauses by similarity

search_rulebook_vector
Read-onlyIdempotent

Search rulebook clauses using natural language queries when exact IDs are unknown. Returns ranked matches with similarity scores for citing.

Instructions

Search the curated rulebook clauses by lexical-vector similarity.

Use this when you know *what* a rule is about but not its exact
``scheme``/``version``/``clause`` id: describe it in natural language and
get back the closest curated clauses, each with a similarity ``score``.
Then pass the winning ``scheme``/``version``/``clause`` to
``cite_rulebook`` for the full citation, or browse everything with
``list_rulebook_clauses``.

Retrieval is a **deterministic lexical-vector cosine** search over the
same curated SEPA / CBPR+ / HVPS+ summaries that back ``cite_rulebook``
(no external, copyrighted, or auth-gated rulebook text is indexed). Each
clause and the query are hashed into a fixed 256-dimension term-frequency
vector (whole words plus character 3/4-grams, BLAKE2b-bucketed so results
are reproducible across processes) and ranked by cosine distance with
``sqlite-vec``. It is offline and does **not** use a large neural
embedding model, so the same query always yields the same ranking and no
model download or network call happens at query time.

``sqlite-vec`` ships in the optional ``[vector]`` extra and is imported
lazily; when it is not installed this returns a graceful
``{"error": ...}`` payload asking the operator to
``pip install 'camt053-mcp[vector]'`` rather than failing to import.

Args:
    query: The natural-language search string.
    top_k: The maximum number of clauses to return (default ``5``,
        clamped to the corpus size).

Returns:
    ``{"query", "top_k", "returned", "method", "results", "disclaimer"}``
    where ``results`` is the ranked list of clause dicts (each with an
    added ``score``), or an ``{"error": ...}`` payload on a bad argument
    or a missing ``[vector]`` extra.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesA natural-language search string (e.g. 'structured address requirement' or 'instant payment settlement time'). Matched against the curated SEPA / CBPR+ / HVPS+ clause summaries.
top_kNoMaximum number of clauses to return, ranked most-similar first. Clamped to the corpus size; must be positive. Defaults to 5.
Behavior5/5

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

Annotations (readOnlyHint, idempotentHint, destructiveHint=false) already cover safety, and the description adds substantial behavior beyond that: deterministic/reproducible ranking, offline operation with no network call, no neural embedding model, and the graceful error when the optional [vector] extra is missing. It even explains the BLAKE2b/256-dim vector mechanics that guarantee identical results across processes. No contradiction with annotations — the deterministic claim aligns with idempotentHint.

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?

Well front-loaded: the one-line purpose and usage guidance come first, followed by behavioral detail and args. It is longer than average, with the technical vector/hashing explanation verging on verbose, but that detail earns its place by substantiating the determinism and offline guarantees an agent needs to trust the tool.

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?

With no output schema, the description compensates fully: the Returns section details the payload shape (query/top_k/returned/method/results/disclaimer), the ranked-clause format with added score, and both error modes (bad argument, missing [vector] extra). Combined with sibling routing and dependency caveats, nothing an agent needs to call it correctly is missing.

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 the input schema already documents both query and top_k richly, including the default 5 and clamping behavior. The description's Args section merely mirrors the schema without adding new meaning, which matches the baseline-3 rubric for high schema coverage.

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 first sentence states a specific verb, resource, and method: 'Search the curated rulebook clauses by lexical-vector similarity.' It also distinguishes itself from siblings by naming cite_rulebook (full citation after finding the id) and list_rulebook_clauses (browse everything), so an agent can immediately tell them apart.

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 states when to use it: 'Use this when you know *what* a rule is about but not its exact scheme/version/clause id'. It then routes to the exact alternatives (cite_rulebook for citation, list_rulebook_clauses for browsing). This is textbook when/when-not guidance with named alternatives.

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/sebastienrousseau/camt053-mcp'

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