Skip to content

Commit efe007e

Browse files
authored
Merge pull request #2708 from DeusData/feat/mcp-profile-instructions
feat(mcp): state the structural questions in the scout and analysis profiles
2 parents 2248ae1 + 5e345e3 commit efe007e

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎src/mcp/mcp.c‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,14 +1473,22 @@ static const char MCP_SERVER_INSTRUCTIONS[] =
14731473
"Results are paginated.";
14741474

14751475
static const char MCP_ANALYSIS_SERVER_INSTRUCTIONS[] =
1476-
"analysis tool profile: read-only graph work via search_graph, trace_path, "
1477-
"get_code_snippet, query_graph, get_architecture, or search_code. Use check_index_coverage "
1478-
"for cited paths; paginate.";
1476+
"analysis tool profile (read-only): a code knowledge graph of the indexed repository for "
1477+
"structural questions: where a symbol is defined, who calls a function, what it calls, call "
1478+
"chains and data flow, which code a change affects, how modules fit together. search_graph "
1479+
"finds symbols; trace_path follows callers, callees and data flow; get_code_snippet returns "
1480+
"exact source; query_graph runs multi-hop Cypher; get_architecture summarizes structure; "
1481+
"search_code combines text search with graph context; detect_changes maps the current diff "
1482+
"to affected symbols. check_index_coverage tells whether a cited file was fully indexed. "
1483+
"Results are paginated.";
14791484

14801485
static const char MCP_SCOUT_SERVER_INSTRUCTIONS[] =
1481-
"scout tool profile: fast positive discovery via search_graph, trace_path, "
1482-
"get_code_snippet, or get_architecture with narrow limits. Use check_index_coverage for "
1483-
"cited paths. Findings are provisional.";
1486+
"scout tool profile (fast, provisional): quick structural lookups in the indexed "
1487+
"repository: where a symbol is defined, who calls a function, what it calls. search_graph "
1488+
"finds symbols; trace_path follows callers and callees; get_code_snippet returns exact "
1489+
"source; get_architecture summarizes structure; narrow limits keep answers fast. "
1490+
"check_index_coverage tells whether a cited file was fully indexed. Findings are "
1491+
"provisional.";
14841492

14851493
static char *cbm_mcp_initialize_response_for_profile(const char *params_json,
14861494
cbm_mcp_tool_profile_t profile) {

‎tests/test_mcp.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,6 +2195,9 @@ TEST(server_handle_analysis_profile_filters_and_rejects_mutators) {
21952195
ASSERT_NOT_NULL(strstr(resp, "analysis tool profile"));
21962196
ASSERT_NOT_NULL(strstr(resp, "check_index_coverage"));
21972197
ASSERT_NULL(strstr(resp, "index_repository"));
2198+
/* Profile instructions name the structural questions, like the default. */
2199+
ASSERT_NOT_NULL(strstr(resp, "who calls a function"));
2200+
ASSERT_NOT_NULL(strstr(resp, "which code a change affects"));
21982201
free(resp);
21992202

22002203
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) {
22372240
ASSERT_NOT_NULL(strstr(resp, "scout tool profile"));
22382241
ASSERT_NOT_NULL(strstr(resp, "check_index_coverage"));
22392242
ASSERT_NULL(strstr(resp, "index_repository"));
2243+
ASSERT_NOT_NULL(strstr(resp, "who calls a function"));
22402244
ASSERT_FALSE(mcp_saw_autoindex_log);
22412245
free(resp);
22422246

0 commit comments

Comments
 (0)