Skip to content

Commit 5e548ba

Browse files
committed
Update prompt
1 parent a32880c commit 5e548ba

2 files changed

Lines changed: 33 additions & 22 deletions

File tree

filesystem/src/main/java/org/tinystruct/mcp/FileSystem.java

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,29 @@ public void init() {
2626
FileSystemTool fsTool = new FileSystemTool();
2727
this.registerTool(fsTool);
2828

29-
// Register a sample prompt (can be customized for FileSystem context)
29+
// Register file-analyzer prompt for FileSystem context
3030
Builder promptSchema = new Builder();
3131
Builder properties = new Builder();
3232

33-
Builder nameParam = new Builder();
34-
nameParam.put("type", "string");
35-
nameParam.put("description", "The name to greet");
33+
Builder pathParam = new Builder();
34+
pathParam.put("type", "string");
35+
pathParam.put("description", "The absolute path to the file or directory to analyze");
3636

37-
properties.put("name", nameParam);
37+
Builder focusParam = new Builder();
38+
focusParam.put("type", "string");
39+
focusParam.put("description", "Specific aspect to focus on (e.g., errors, performance, code style)");
40+
41+
properties.put("path", pathParam);
42+
properties.put("focus", focusParam);
43+
3844
promptSchema.put("type", "object");
3945
promptSchema.put("properties", properties);
40-
promptSchema.put("required", new String[]{"name"});
46+
promptSchema.put("required", new String[]{"path"});
4147

42-
MCPPrompt greetingPrompt = new MCPPrompt(
43-
"greeting",
44-
"A simple greeting prompt",
45-
"Hello, {{name}}! Welcome to the FileSystem MCP server.",
48+
MCPPrompt fileAnalyzerPrompt = new MCPPrompt(
49+
"file-analyzer",
50+
"Analyze file content or a directory listing for key insights",
51+
"Please analyze the file or directory at {{path}} and provide a detailed summary of its structure, contents, and potential issues. Focus specifically on: {{focus}}.",
4652
promptSchema,
4753
null
4854
) {
@@ -52,7 +58,7 @@ protected boolean supportsLocalExecution() {
5258
}
5359
};
5460

55-
this.registerPrompt(greetingPrompt);
61+
this.registerPrompt(fileAnalyzerPrompt);
5662
}
5763

5864
@Override

github/src/main/java/org/tinystruct/mcp/GitHub.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,28 @@ public void init() {
3737
GitHubTool githubTool = new GitHubTool();
3838
this.registerTool(githubTool);
3939

40-
// Register a sample prompt (can be customized for GitHub context)
40+
// Register git-commit-helper prompt for GitHub context
4141
Builder promptSchema = new Builder();
4242
Builder properties = new Builder();
4343

44-
Builder nameParam = new Builder();
45-
nameParam.put("type", "string");
46-
nameParam.put("description", "The name to greet");
44+
Builder statusParam = new Builder();
45+
statusParam.put("type", "string");
46+
statusParam.put("description", "The output of git status");
4747

48-
properties.put("name", nameParam);
48+
Builder diffParam = new Builder();
49+
diffParam.put("type", "string");
50+
diffParam.put("description", "The output of git diff");
51+
52+
properties.put("status", statusParam);
53+
properties.put("diff", diffParam);
4954
promptSchema.put("type", "object");
5055
promptSchema.put("properties", properties);
51-
promptSchema.put("required", new String[]{"name"});
56+
promptSchema.put("required", new String[]{"status"});
5257

53-
MCPPrompt greetingPrompt = new MCPPrompt(
54-
"greeting",
55-
"A simple greeting prompt",
56-
"Hello, {{name}}! Welcome to the GitHub MCP server.",
58+
MCPPrompt gitCommitHelperPrompt = new MCPPrompt(
59+
"git-commit-helper",
60+
"Generate a professional git commit message based on git status and diff",
61+
"Generate a conventional and professional Git commit message based on the following git status:\n{{status}}\n\nAnd git diff:\n{{diff}}",
5762
promptSchema,
5863
null
5964
) {
@@ -63,7 +68,7 @@ protected boolean supportsLocalExecution() {
6368
}
6469
};
6570

66-
this.registerPrompt(greetingPrompt);
71+
this.registerPrompt(gitCommitHelperPrompt);
6772
}
6873

6974
@Override

0 commit comments

Comments
 (0)