Class GlobalMemberSearchTool

java.lang.Object
com.github._1c_syntax.bsl.languageserver.mcp.tools.GlobalMemberSearchTool

@Component @Profile("mcp") public class GlobalMemberSearchTool extends Object
MCP-инструмент global_member_search: ищет члены глобального контекста 1С/BSL, доступные без префикса — глобальные функции (Сообщить/Message, СтартовыйСценарий/StartupScript), глобальные свойства (Метаданные/Metadata) и системные перечисления. Каждый член отдаётся полным TypeMemberDto с сигнатурами/типом значения и платформенной метаинформацией, сгруппированным по категории.

Совпадение запроса query считается тем же нечётким матчером FuzzyMatcher, что и автодополнение редактора: точное имя → префикс → подстрока → подпоследовательность, по обоим написаниям (ru/en). Результаты внутри категории ранжируются по релевантности (наиболее релевантные — первыми), как в автодополнении.

Дополняет точечный GlobalMemberInfoTool: когда точное имя неизвестно, ЛЛМ ищет глобальные члены (опционально сужая выборку категориями categories) и находит нужный, не открывая конкретный файл.

Поиск выполняется в рабочей папке, указанной клиентом через обязательный параметр workspaceFolder.

  • Constructor Details

  • Method Details

    • globalMemberSearch

      @McpTool(name="global_member_search", description="Search 1C/BSL global context members callable without a prefix \u2014 global functions (`\u0421\u043e\u043e\u0431\u0449\u0438\u0442\u044c`/`Message`, `\u0421\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439`/`StartupScript`), global properties (`\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435`/`Metadata`) and system enums \u2014 grouped by category, with signatures, value/return types and platform metadata. The query is matched with the same fuzzy matcher as the editor's autocomplete (exact > prefix > substring > subsequence, over both Russian and English spelling) and results are ranked by relevance. Optionally restrict to categories. Omit the query to list every member. Use it to discover a member when the exact name is unknown, then call `global_member_info` for a single member by exact name.", generateOutputSchema=false, annotations=) public GlobalMemberSearchTool.Result globalMemberSearch(@McpToolParam(required=true,description="File language: `BSL` for 1C:Enterprise BSL or `OS` for OneScript.") FileType fileType, @McpToolParam(required=true,description="URI of the workspace folder to answer for \u2014 one of the `uri` values returned by the `list_workspace_folders` tool. Required because the answer can differ between folders: 1C configuration vs OneScript project, different configurations, different library sets. For purely platform names any registered folder will do. Do not guess this value: call `list_workspace_folders` first and, if the project is not there yet, register it with `register_workspace_folder`.") String workspaceFolder, @McpToolParam(required=false,description="Optional search query matched fuzzily against member names (exact > prefix > substring > subsequence, case-insensitive, over both the Russian and English spelling, e.g. `\u0421\u0446\u0435\u043d\u0430\u0440` / `Script`), like the editor's autocomplete. Results are ranked by relevance. When omitted, every member in the selected categories is returned.") @Nullable String query, @McpToolParam(required=false,description="Optional list of categories to include: `FUNCTION` (global functions/procedures), `PROPERTY` (global properties) and/or `ENUM` (system enums). When omitted or empty, all categories are searched.") @Nullable List<GlobalMemberCategory> categories, @McpToolParam(required=false,description="Language for names and descriptions: `RU` (default) or `EN`.") @Nullable Language language)