run-llama/llama_index · error · ValueError

Real function is not set!

Error message

Real function is not set!

What it means

Error "Real function is not set!" thrown in run-llama/llama_index.

Source

Thrown at llama-index-core/llama_index/core/tools/function_tool.py:287

    def metadata(self) -> ToolMetadata:
        """Metadata."""
        return self._metadata

    @property
    def fn(self) -> Callable[..., Any]:
        """Function."""
        return self._fn

    @property
    def async_fn(self) -> AsyncCallable:
        """Async function."""
        return self._async_fn

    @property
    def real_fn(self) -> Union[Callable[..., Any], AsyncCallable]:
        """Real function."""
        if self._real_fn is None:
            raise ValueError("Real function is not set!")

        return self._real_fn

    def _parse_tool_output(self, raw_output: Any) -> List[ContentBlock]:
        """Parse tool output into content blocks."""
        if isinstance(
            raw_output,
            (
                TextBlock,
                ImageBlock,
                AudioBlock,
                CitableBlock,
                CitationBlock,
                DocumentBlock,
                VideoBlock,
            ),
        ):
            return [raw_output]

View on GitHub (pinned to afd0fef371)

Solutions

  1. Set the real function via fn before calling the tool.
  2. Construct the tool with FunctionTool.from_defaults(fn=...) so the function is attached.

When it happens

Trigger: Thrown at llama-index-core/llama_index/core/tools/function_tool.py:287 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/47d32c1610b3e263. Report an issue: GitHub.