serena.tools.query_project_tools#


class ListQueryableProjectsTool(agent)[source]#

Bases: Tool, ToolMarkerOptional, ToolMarkerDoesNotRequireActiveProject

Tool for listing all projects that can be queried by the QueryProjectTool.

Parameters:

agent (SerenaAgent)

apply(symbol_access=True)[source]#

Lists available projects that can be queried with query_project_tool.

Parameters:

symbol_access (bool) – whether to return only projects for which symbol access is available. Default: true

Returns:

project names and roots

Return type:

str

class QueryProjectTool(agent)[source]#

Bases: Tool, ToolMarkerOptional, ToolMarkerDoesNotRequireActiveProject

Tool for querying external project information (i.e. information from projects other than the current one), by executing a read-only tool.

Parameters:

agent (SerenaAgent)

apply(project_name, tool_name, tool_params_json)[source]#

Queries a project by executing a read-only Serena tool. The tool will be executed in the context of the project. Use this to query information from projects other than the activated project.

Parameters:
  • project_name (str) – the name of the project to query (or root path)

  • tool_name (str) – the name of the tool to execute in the other project. The tool must be read-only.

  • tool_params_json (str) – the parameters to pass to the tool, encoded as a JSON string

Return type:

str