Skip to main content
Glama
chacharin

mcp-lightrag

by chacharin

query

Answer questions by retrieving relevant knowledge-graph context, returning cited answers with source references.

Instructions

Answer a question using the knowledge base (RAG). Use this for any question about the content stored in LightRAG -- it retrieves relevant context and has an LLM compose the answer. Returns response (the answer text) and, by default, references (the source documents it drew on).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoRetrieval mode. 'mix' (default) combines knowledge-graph and vector retrieval and is the best general-purpose choice. 'local' favors entities near the query, 'global' favors relationships, 'hybrid' combines local+global, 'naive' is plain vector search, and 'bypass' skips retrieval entirely and sends the query straight to the LLM.mix
queryYesThe question or instruction to answer using the knowledge base. Must not be empty.
top_kNoNumber of top items to retrieve: entities in 'local' mode, relationships in 'global' mode.
chunk_top_kNoNumber of text chunks to retrieve and keep after reranking.
hl_keywordsNoHigh-level keywords to prioritize in retrieval. Leave empty to let LightRAG derive them.
ll_keywordsNoLow-level keywords to refine retrieval focus. Leave empty to let LightRAG derive them.
user_promptNoExtra instructions for the answering LLM. Does not affect retrieval.
enable_rerankNoEnable reranking of retrieved text chunks, if a rerank model is configured.
response_typeNoDesired response format, e.g. 'Multiple Paragraphs', 'Single Paragraph', 'Bullet Points'.
max_total_tokensNoMaximum total token budget for the whole query context (entities + relations + chunks + system prompt).
only_need_promptNoReturn only the assembled prompt, without calling the LLM.
max_entity_tokensNoMaximum tokens allocated to entity context.
only_need_contextNoReturn only the retrieved context, without generating an answer.
include_referencesNoInclude the list of source documents the answer drew on. Keep this true (the default) so answers can cite which document they came from.
max_relation_tokensNoMaximum tokens allocated to relationship context.
conversation_historyNoPrior turns for context only (not used for retrieval), as [{'role': 'user'|'assistant', 'content': '...'}, ...].
include_chunk_contentNoInclude the actual chunk text in each reference (for debugging/evaluation); only applies when include_references is true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses that the tool retrieves context, has an LLM compose the answer, and returns response and references by default. It does not cover cost, latency, or how flags like only_need_prompt alter behavior, which limits transparency.

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 three sentences with the core action front-loaded and no wasted words. It efficiently states purpose, usage context, and return values.

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 tool with 17 parameters and an output schema, the description covers the central purpose and return shape well, while the schema handles parameter details. It does not mention sibling query_data or prerequisites like needing ingested documents, but these are secondary given the other available context.

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?

The input schema has 100% description coverage, so all 17 parameters are already documented in structured form. The description does not add parameter-level meaning beyond the schema, which justifies the baseline score of 3.

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 clearly states the tool answers a question using the knowledge base (RAG) over LightRAG content, with a specific verb and resource. However, it does not distinguish this tool from the sibling query_data, so the differentiation is not explicit.

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 explicitly says 'Use this for any question about the content stored in LightRAG,' giving clear context for when to invoke it. It does not mention alternatives or when not to use the tool, so it stops short of a 5.

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