Skip to main content
Glama
chacharin

mcp-lightrag

by chacharin

query_data

Retrieve raw entities, relationships, and text chunks relevant to a query for custom answer generation. Get evidence with references to compose your own response.

Instructions

Retrieve the raw entities, relationships and text chunks relevant to a question, WITHOUT having LightRAG's LLM compose an answer. Use this instead of query when the caller (e.g. Hermes) wants to compose its own answer from the retrieved evidence. Always includes references.

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).
max_entity_tokensNoMaximum tokens allocated to entity context.
max_relation_tokensNoMaximum tokens allocated to relationship context.
conversation_historyNoPrior turns for context only (not used for retrieval), as [{'role': 'user'|'assistant', 'content': '...'}, ...].

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Discloses two non-obvious behaviors: it does not invoke LightRAG's LLM to compose an answer, and the result always includes references. However, no annotations exist, so the description carries the full transparency burden for a retrieval tool, and it omits the `bypass`-mode exception and any read-only/no-side-effect caveat.

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?

Three short, purposeful sentences: core behavior, when-to-use rule, and return guarantee. Everything is front-loaded, with no filler or repetition of schema content.

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 13-parameter tool, the schema covers parameter semantics and the output schema covers return shape, so the description only needs selection guidance and high-level behavior. It supplies that, including the key `query` alternative; the only gap is the unqualified no-LLM claim versus the `bypass` mode.

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 coverage is 100%, with detailed descriptions for all 13 parameters including mode semantics, so the description adds no parameter-level meaning. The description's mention of 'raw entities, relationships and text chunks' is high-level context rather than parameter guidance, matching the baseline for fully documented schemas.

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?

States a specific verb ('retrieve') and resource ('raw entities, relationships and text chunks'), and distinguishes itself from the `query` sibling by saying the LLM does not compose an answer. The wording is slightly overbroad because the schema's `mode` enum includes `bypass`, which sends the query straight to the LLM, contradicting the absolute 'WITHOUT' claim.

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 says to use this tool instead of `query` when the caller wants to compose its own answer from retrieved evidence, naming a concrete caller (Hermes). This provides a clear, actionable routing rule with no inference required.

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