oraios/serena · error · ToolCallError

Tool '{self.get_name_from_cls()}' is not active. Active tool

Error message

Tool '{self.get_name_from_cls()}' is not active. Active tools: {self.agent.get_active_tool_names()}

What it means

Every tool execution goes through task(), which checks self.is_active() before dispatching to apply. If the tool's name is not in the agent's active-tools set (disabled via config or the toggle_tool tool), the call is rejected with ToolCallError listing the currently active tools.

Source

Thrown at src/serena/tools/tools_base.py:359

        if mcp_ctx is not None:
            try:
                session_id = "%x" % id(mcp_ctx.session)
                client_params = mcp_ctx.session.client_params
                if client_params is not None:
                    client_info = cast(Implementation, client_params.clientInfo)
                    client_str = client_info.title if client_info.title else client_info.name + " " + client_info.version
                    if client_str != self.get_last_tool_call_client_str():
                        log.debug(f"Updating client info: {client_info}")
                        self.set_last_tool_call_client_str(client_str)
            except Exception as e:
                log.info(f"Failed to get client info: {e}.")

        def task() -> str:
            apply_fn = self.get_apply_fn()

            try:
                if not self.is_active():
                    raise ToolCallError(
                        f"Tool '{self.get_name_from_cls()}' is not active. Active tools: {self.agent.get_active_tool_names()}"
                    )

                if log_call:
                    self._log_tool_application(inspect.currentframe(), session_id)

                # check whether the tool requires an active project and language server
                if not isinstance(self, ToolMarkerDoesNotRequireActiveProject):
                    if self.agent.get_active_project() is None:
                        raise ToolCallError(
                            "No active project. Ask the user to provide the project path or to select a project from this list of known projects: "
                            + f"{self.agent.serena_config.project_names}"
                        )

                # construct apply kwargs, adding session_id if the tool is session-aware
                apply_kwargs = dict(kwargs)
                if self._is_session_aware:
                    apply_kwargs["session_id"] = session_id

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Enable the tool in the serena/project configuration (active_tools/enabled_tools)
  2. Use the tool-management mechanism (e.g. activate_tool / config edit) to turn it on at runtime
  3. Pick an alternative tool that is already active — the message lists active tool names

Example fix

// before
result = inactive_tool.apply(...)  # tool disabled in project config
// ToolCallError: Tool 'x' is not active...

// after (config, .serena/project.yml)
# remove 'x' from excluded_tools / add to activated_tools, then
result = agent.get_tool(XTool).apply(...)
Defensive patterns

Strategy: try-catch

Validate before calling

tool_cls = type(agent.get_tool(MyTool))
name = tool_cls.get_name_from_cls()
if name not in agent.get_active_tool_names():
    raise SkipToolCall(f'{name} disabled; use an alternative')

Type guard

def tool_active(agent, tool_cls) -> bool:
    return tool_cls.get_name_from_cls() in agent.get_active_tool_names()

Try / catch

try:
    result = tool.apply(...)
except ToolCallError as e:
    if 'is not active' in str(e):
        enable_tool_in_config(name)  # or pick alternative tool
        result = tool.apply(...)
    else:
        raise

Prevention

When it happens

Trigger: Calling an apply/execute method of a tool excluded by the project's enabled_tools/disabled_tools config; a tool was deactivated at runtime via tool toggling; calling the wrong agent instance whose tool set doesn't include it.

Common situations: Project config restricts tools for safety; agents try memory or shell tools that are disabled by default; stale agent code references a tool renamed or disabled in a newer serena version.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/2aaa51ab688d10ee. Report an issue: GitHub.