Skip to main content
Glama

Initial Instructions

initial_instructions
Read-only

Access essential instructions for using the Serena toolbox to understand its capabilities and proper operation.

Instructions

Provides the 'Serena Instructions Manual', which contains essential information on how to use the Serena toolbox. IMPORTANT: If you have not yet read the manual, call this tool immediately after you are given your task by the user, as it will critically inform you!.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler for the 'initial_instructions' tool. The apply() method executes the tool logic by calling self.agent.create_system_prompt(), providing the initial instructions manual.
    class InitialInstructionsTool(Tool, ToolMarkerDoesNotRequireActiveProject):
        """
        Provides instructions on how to use the Serena toolbox.
        Should only be used in settings where the system prompt is not read automatically by the client.
    
        NOTE: Some MCP clients (including Claude Desktop) do not read the system prompt automatically!
        """
    
        def apply(self) -> str:
            """
            Provides the 'Serena Instructions Manual', which contains essential information on how to use the Serena toolbox.
            IMPORTANT: If you have not yet read the manual, call this tool immediately after you are given your task by the user,
            as it will critically inform you!
            """
            return self.agent.create_system_prompt()
  • ToolRegistry discovers and registers all Tool subclasses from serena.tools packages, including InitialInstructionsTool as 'initial_instructions' (derived from class name). This is where the tool gets registered in the agent's tool set.
    for cls in iter_subclasses(Tool):
        if not any(cls.__module__.startswith(pkg) for pkg in tool_packages):
            continue
        is_optional = issubclass(cls, ToolMarkerOptional)
        name = cls.get_name_from_cls()
        if name in self._tool_dict:
            raise ValueError(f"Duplicate tool name found: {name}. Tool classes must have unique names.")
        self._tool_dict[name] = RegisteredTool(tool_class=cls, is_optional=is_optional, tool_name=name)
  • The get_name_from_cls method derives the MCP tool name 'initial_instructions' from the class name InitialInstructionsTool.
    def get_name_from_cls(cls) -> str:
        name = cls.__name__
        if name.endswith("Tool"):
            name = name[:-4]
        # convert to snake_case
        name = "".join(["_" + c.lower() if c.isupper() else c for c in name]).lstrip("_")
        return name
    
    def get_name(self) -> str:
        return self.get_name_from_cls()
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, indicating a safe read operation. The description adds that it provides 'essential information' and is 'critical' to inform the agent, which adds context about importance. However, it doesn't specify format, length, or structure of the manual content beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences that each serve distinct purposes: stating what the tool provides and giving critical usage instructions. It's front-loaded with the core purpose, though the second sentence could be slightly more streamlined.

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?

Given the tool has 0 parameters, annotations covering safety, and an output schema exists, the description provides adequate context about purpose and critical timing. It doesn't need to explain return values since output schema exists, but could optionally hint at manual content format for slightly better completeness.

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, focusing instead on the tool's purpose and usage timing.

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?

The description clearly states the tool 'provides the Serena Instructions Manual' which is a specific resource, though it doesn't specify the exact content or format of the manual. It distinguishes itself from siblings by being the only tool focused on providing essential instructions rather than performing project operations.

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?

The description provides explicit usage guidance: 'If you have not yet read the manual, call this tool immediately after you are given your task by the user, as it will critically inform you!' This clearly indicates when to use it (immediately after task assignment if manual not read) and implies it's foundational before using other 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