run-llama/llama_index · error · ValueError
Cannot call query engine without inputs
Error message
Cannot call query engine without inputs
What it means
Error "Cannot call query engine without inputs" thrown in run-llama/llama_index.
Source
Thrown at llama-index-core/llama_index/core/tools/retriever_tool.py:85
@property
def retriever(self) -> BaseRetriever:
return self._retriever
@property
def metadata(self) -> ToolMetadata:
return self._metadata
def call(self, *args: Any, **kwargs: Any) -> ToolOutput:
query_str = ""
if args is not None:
query_str += ", ".join([str(arg) for arg in args]) + "\n"
if kwargs is not None:
query_str += (
", ".join([f"{k!s} is {v!s}" for k, v in kwargs.items()]) + "\n"
)
if query_str == "":
raise ValueError("Cannot call query engine without inputs")
docs = self._retriever.retrieve(query_str)
docs = self._apply_node_postprocessors(docs, QueryBundle(query_str))
content = ""
for doc in docs:
assert isinstance(doc.node, (Node, TextNode))
node_copy = doc.node.model_copy()
content += node_copy.get_content(MetadataMode.LLM) + "\n\n"
return ToolOutput(
content=content,
tool_name=self.metadata.get_name(),
raw_input={"input": query_str},
raw_output=docs,
)
async def acall(self, *args: Any, **kwargs: Any) -> ToolOutput:
query_str = ""
if args is not None:View on GitHub (pinned to afd0fef371)
Solutions
- Pass inputs when calling the retriever tool's query engine.
- Verify the tool schema so the calling agent supplies the required input.
When it happens
Trigger: Thrown at llama-index-core/llama_index/core/tools/retriever_tool.py:85 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15).
Data as JSON: /api/errors/84e1187412b28936.
Report an issue: GitHub.