Skip to content

Commit 9b8f38b

Browse files
committed
feat: aggressive enforcement prompt for CodeGraph MCP tools
Rewrite initial_instructions.md with mandatory compliance language: - MANDATORY RULE #1-3 at the top enforcing CodeGraph-first approach - ALWAYS/NEVER lists with explicit violation warnings - Quick decision tree for tool selection - Anti-pattern examples labeled as VIOLATIONS - Context efficiency mathematics (7.8x more efficient) - Compliance checklist before using built-in tools - REQUIRED workflows for features, debugging, learning, refactoring Update prompt metadata with MANDATORY/REQUIRED language in title and description to emphasize non-negotiable nature. Agents reading this prompt will be strongly guided to use agentic_* tools before grep/read/find operations.
1 parent ab34c75 commit 9b8f38b

File tree

2 files changed

+327
-432
lines changed

2 files changed

+327
-432
lines changed

crates/codegraph-mcp/src/official_server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,9 @@ impl ServerHandler for CodeGraphMCPServer {
803803
Ok(ListPromptsResult {
804804
prompts: vec![Prompt {
805805
name: "codegraph_initial_instructions".to_string(),
806-
title: Some("CodeGraph Initial Instructions for AI Agents".to_string()),
806+
title: Some("MANDATORY: CodeGraph Usage Protocol for AI Agents".to_string()),
807807
description: Some(
808-
"Essential guide for using CodeGraph MCP tools efficiently. Learn when to use CodeGraph tools vs manual file reading, tool selection framework, context efficiency best practices, and common workflows.".to_string()
808+
"REQUIRED reading before using CodeGraph tools. Enforces context-efficient tool usage patterns. You MUST use CodeGraph agentic tools BEFORE grep/read/find. Includes tool selection decision tree, anti-patterns, and compliance checklist.".to_string()
809809
),
810810
arguments: None,
811811
icons: None,
@@ -825,7 +825,7 @@ impl ServerHandler for CodeGraphMCPServer {
825825
match name.as_str() {
826826
"codegraph_initial_instructions" => Ok(GetPromptResult {
827827
description: Some(
828-
"CodeGraph Initial Instructions - Essential guide for context-efficient tool usage".to_string()
828+
"MANDATORY: CodeGraph Usage Protocol - You MUST read and follow these instructions before using any CodeGraph tools".to_string()
829829
),
830830
messages: vec![
831831
PromptMessage {

0 commit comments

Comments
 (0)