Merge pull request #2708 from DeusData/feat/mcp-profile-instructions

feat(mcp): state the structural questions in the scout and analysis profiles
This commit is contained in:
Martin Vogel authored and GitHub committed 2026-10-19 21:58:51 +02:00
commit efe007ea1b
2 files changed
+18 -6

No files matched your search

+14 -6
View File
@@ -1473,14 +1473,22 @@ static const char MCP_SERVER_INSTRUCTIONS[] =
"Results are paginated.";
static const char MCP_ANALYSIS_SERVER_INSTRUCTIONS[] =
"analysis tool profile: read-only graph work via search_graph, trace_path, "
"get_code_snippet, query_graph, get_architecture, or search_code. Use check_index_coverage "
"for cited paths; paginate.";
"analysis tool profile (read-only): a code knowledge graph of the indexed repository for "
"structural questions: where a symbol is defined, who calls a function, what it calls, call "
"chains and data flow, which code a change affects, how modules fit together. search_graph "
"finds symbols; trace_path follows callers, callees and data flow; get_code_snippet returns "
"exact source; query_graph runs multi-hop Cypher; get_architecture summarizes structure; "
"search_code combines text search with graph context; detect_changes maps the current diff "
"to affected symbols. check_index_coverage tells whether a cited file was fully indexed. "
"Results are paginated.";
static const char MCP_SCOUT_SERVER_INSTRUCTIONS[] =
"scout tool profile: fast positive discovery via search_graph, trace_path, "
"get_code_snippet, or get_architecture with narrow limits. Use check_index_coverage for "
"cited paths. Findings are provisional.";
"scout tool profile (fast, provisional): quick structural lookups in the indexed "
"repository: where a symbol is defined, who calls a function, what it calls. search_graph "
"finds symbols; trace_path follows callers and callees; get_code_snippet returns exact "
"source; get_architecture summarizes structure; narrow limits keep answers fast. "
"check_index_coverage tells whether a cited file was fully indexed. Findings are "
"provisional.";
static char *cbm_mcp_initialize_response_for_profile(const char *params_json,
cbm_mcp_tool_profile_t profile) {
+4
View File
@@ -2195,6 +2195,9 @@ TEST(server_handle_analysis_profile_filters_and_rejects_mutators) {
ASSERT_NOT_NULL(strstr(resp, "analysis tool profile"));
ASSERT_NOT_NULL(strstr(resp, "check_index_coverage"));
ASSERT_NULL(strstr(resp, "index_repository"));
/* Profile instructions name the structural questions, like the default. */
ASSERT_NOT_NULL(strstr(resp, "who calls a function"));
ASSERT_NOT_NULL(strstr(resp, "which code a change affects"));
free(resp);
resp = cbm_mcp_server_handle(srv, "{\"jsonrpc\":\"2.0\",\"id\":220,\"method\":\"tools/list\"}");
@@ -2237,6 +2240,7 @@ TEST(server_handle_scout_profile_exposes_only_the_fast_tier) {
ASSERT_NOT_NULL(strstr(resp, "scout tool profile"));
ASSERT_NOT_NULL(strstr(resp, "check_index_coverage"));
ASSERT_NULL(strstr(resp, "index_repository"));
ASSERT_NOT_NULL(strstr(resp, "who calls a function"));
ASSERT_FALSE(mcp_saw_autoindex_log);
free(resp);