Skip to main content
Glama

Get Current Config

get_current_config
Read-only

Retrieve the current agent configuration to view active projects, available tools, contexts, and operational modes.

Instructions

Print the current configuration of the agent, including the active and available projects, tools, contexts, and modes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The GetCurrentConfigTool class defines the MCP tool 'get_current_config'. Its apply() method executes the tool logic by delegating to the agent's get_current_config_overview().
    class GetCurrentConfigTool(Tool):
        """
        Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
        """
    
        def apply(self) -> str:
            """
            Print the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
            """
            return self.agent.get_current_config_overview()
  • Core logic that generates a detailed string overview of the current Serena agent configuration, including version, log level, projects, context, modes, and active/available tools. Called by the tool handler.
    def get_current_config_overview(self) -> str:
        """
        :return: a string overview of the current configuration, including the active and available configuration options
        """
        result_str = "Current configuration:\n"
        result_str += f"Serena version: {serena_version()}\n"
        result_str += f"Loglevel: {self.serena_config.log_level}, trace_lsp_communication={self.serena_config.trace_lsp_communication}\n"
        if self._active_project is not None:
            result_str += f"Active project: {self._active_project.project_name}\n"
        else:
            result_str += "No active project\n"
        result_str += "Available projects:\n" + "\n".join(list(self.serena_config.project_names)) + "\n"
        result_str += f"Active context: {self._context.name}\n"
    
        # Active modes
        active_mode_names = [mode.name for mode in self.get_active_modes()]
        result_str += "Active modes: {}\n".format(", ".join(active_mode_names)) + "\n"
    
        # Available but not active modes
        all_available_modes = SerenaAgentMode.list_registered_mode_names()
        inactive_modes = [mode for mode in all_available_modes if mode not in active_mode_names]
        if inactive_modes:
            result_str += "Available but not active modes: {}\n".format(", ".join(inactive_modes)) + "\n"
    
        # Active tools
        result_str += "Active tools (after all exclusions from the project, context, and modes):\n"
        active_tool_names = self.get_active_tool_names()
        # print the tool names in chunks
        chunk_size = 4
        for i in range(0, len(active_tool_names), chunk_size):
            chunk = active_tool_names[i : i + chunk_size]
            result_str += "  " + ", ".join(chunk) + "\n"
    
        # Available but not active tools
        all_tool_names = sorted([tool.get_name_from_cls() for tool in self._all_tools.values()])
        inactive_tool_names = [tool for tool in all_tool_names if tool not in active_tool_names]
        if inactive_tool_names:
            result_str += "Available but not active tools:\n"
            for i in range(0, len(inactive_tool_names), chunk_size):
                chunk = inactive_tool_names[i : i + chunk_size]
                result_str += "  " + ", ".join(chunk) + "\n"
    
        return result_str
  • ToolRegistry automatically discovers all Tool subclasses in serena.tools package (including GetCurrentConfigTool) via iter_subclasses(Tool) and registers them for instantiation in SerenaAgent.
    return list(t.tool_class for t in self._tool_dict.values())
  • SerenaAgent instantiates all registered tools, including GetCurrentConfigTool, using ToolRegistry.get_all_tool_classes() during agent initialization.
    self._all_tools: dict[type[Tool], Tool] = {tool_class: tool_class(self) for tool_class in ToolRegistry().get_all_tool_classes()}
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering safety. The description adds valuable context by specifying what configuration components are included (projects, tools, contexts, modes), which isn't inferable from annotations alone. However, it doesn't mention output format details or potential limitations.

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 a single, efficient sentence that front-loads the core action ('Print the current configuration') and then enumerates included components. Every word adds value with zero redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, read-only, non-destructive), the description fully covers its purpose and scope. With annotations providing safety context and an output schema existing (so return values needn't be described), the description is complete for this low-complexity tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description appropriately doesn't discuss parameters since none exist, avoiding unnecessary detail while clearly indicating the tool operates without inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Print') and the exact resource ('current configuration of the agent'), listing all included components (active/available projects, tools, contexts, modes). It distinguishes itself from siblings like 'get_symbols_overview' or 'list_memories' by focusing on overall agent configuration rather than specific data subsets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to inspect the agent's configuration state, but provides no explicit guidance on when to use this versus alternatives like 'check_onboarding_performed' or 'switch_modes'. It doesn't specify prerequisites, exclusions, or comparative contexts with sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oraios/serena'

If you have feedback or need assistance with the MCP directory API, please join our Discord server