Skip to main content
Glama

set_rag_settings

Idempotent

Updates RAG pipeline settings—passage count, answer length, timeouts, reranker, and embedding model—so the next query uses the new configuration.

Instructions

Change the RAG pipeline from plain words: passages supplied to synthesis (top), answer length, timeouts, the reranker (off, auto, fastembed, openrouter or a model name), or the embedding model (guessing where it runs: Ollama, a small local ONNX model, or an API whose key is already in the environment). For a detected local OpenAI-compatible model, pass embedding_runtime from get_rag_models (LM Studio or vLLM). Never pass API keys here; the user enters keys with rag setup in a terminal. The next query uses the new settings.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "set_rag_settings"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoHow many reranked passages answer synthesis may use
rerankerNooff | auto | fastembed | openrouter | a reranker model name
revisionNoOptional revision from get_rag_settings; reject a stale edit before saving.
candidatesNoCandidate passages before reranking
answer_modelNoOpenRouter answer model ID
answer_timeoutNoSeconds to wait for the answer model
context_radiusNoNeighbouring chunks on each side of an answer passage; 0 is off
embedding_modelNoEmbedding model name, e.g. qwen/qwen3-embedding-4b or BAAI/bge-small-en-v1.5
whole_documentsNoAnswer from a whole document of at most this many characters, not its passages; 0 is off
reranker_timeoutNoSeconds to wait for the reranker
answer_max_tokensNoLargest answer length in tokens
embedding_runtimeNoDetected local OpenAI-compatible runtime label (LM Studio or vLLM) when choosing its embedding model
embedding_providerNoWhere the embedding model runs; guessed when omitted
contextual_retrievalNoEnable or disable Anthropic-style ingestion-time contextual retrieval

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, destructiveHint=false, openWorldHint=true, so the mutation/idempotency profile is covered structurally. The description adds two genuinely useful behavioral facts beyond that: the security boundary around API keys and that 'the next query uses the new settings' (effect timing). However, with 14 all-optional parameters it never states partial-update semantics — whether omitted fields are preserved — which is the key behavioral unknown for this tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the verb and an enumeration of changeable settings, but the opening sentence is an overlong trailing list that restates schema enum values and ranges rather than summarizing. The parenthetical about guessing the embedding runtime is wordy and could be compressed to a single clause.

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 14-parameter, zero-required, no-output-schema mutation tool, it covers the highest-risk items: API-key handling, the runtime-label source, and when the change takes effect. The remaining gap is merge-vs-replace semantics for omitted parameters, which an agent needs in order to call this safely.

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?

With 100% schema coverage the baseline is 3, and the description earns a step up by explaining how embedding_provider is resolved ('guessing where it runs: Ollama, a small local ONNX model, or an API whose key is already in the environment') and by tying embedding_runtime to get_rag_models. Duplicating the reranker enum values ('off, auto, fastembed, openrouter') adds nothing the schema doesn't already say.

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?

The description gives a clear verb+resource ('Change the RAG pipeline') and enumerates the families of settings it governs (top, answer length, timeouts, reranker, embedding model), so an agent knows this is the mutation counterpart to get_rag_settings. It never explicitly names get_rag_settings as the read-side sibling, so differentiation is inferred rather than stated.

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?

It provides real usage context: 'For a detected local OpenAI-compatible model, pass embedding_runtime from get_rag_models', plus a hard exclusion — 'Never pass API keys here; the user enters keys with `rag setup` in a terminal.' What's missing is sequencing guidance such as reading current settings (and the revision token) before editing, which only appears inside the schema.

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