Skip to content

Commit a6d93f9

Browse files
committed
add args desc
1 parent dbd1179 commit a6d93f9

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

src-tauri/src/mcp_server.rs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,55 @@ use tracing;
2121

2222
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
2323
pub struct CreateSnippetRequest {
24+
#[schemars(description = "Title of the code snippet")]
2425
pub title: String,
26+
#[schemars(description = "Content of the code snippet")]
2527
pub code: String,
28+
#[schemars(
29+
description = "Programming language type, e.g., 'javascript', 'python', 'rust', etc."
30+
)]
2631
pub language: String,
32+
#[schemars(description = "Optional list of tags for categorization and search")]
2733
pub tags: Option<Vec<String>>,
2834
}
2935

3036
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
3137
pub struct UpdateSnippetRequest {
38+
#[schemars(description = "ID of the code snippet to update")]
3239
pub id: i64,
40+
#[schemars(description = "Optional title update")]
3341
pub title: Option<String>,
42+
#[schemars(description = "Optional code content update")]
3443
pub code: Option<String>,
44+
#[schemars(description = "Optional programming language update")]
3545
pub language: Option<String>,
46+
#[schemars(description = "Optional tags list update")]
3647
pub tags: Option<Vec<String>>,
3748
}
3849

3950
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
4051
pub struct SearchSnippetRequest {
52+
#[schemars(description = "Search keyword to match in title and code content")]
4153
pub query: String,
54+
#[schemars(description = "Optional programming language filter")]
4255
pub language: Option<String>,
56+
#[schemars(
57+
description = "Optional tags filter - only return snippets containing specified tags"
58+
)]
4359
pub tags: Option<Vec<String>>,
4460
}
4561

4662
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
4763
pub struct IdRequest {
64+
#[schemars(description = "Unique identifier of the code snippet")]
4865
pub id: i64,
4966
}
5067

5168
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
5269
pub struct ListRequest {
70+
#[schemars(description = "Page number, defaults to 1")]
5371
pub page: Option<u64>,
72+
#[schemars(description = "Number of items per page, defaults to 20")]
5473
pub limit: Option<u64>,
5574
}
5675

@@ -79,7 +98,9 @@ impl SnippetService {
7998
}
8099
}
81100

82-
#[tool(description = "Create a new code snippet")]
101+
#[tool(
102+
description = "Create a new code snippet in SeekCode with title, code content, programming language and tags"
103+
)]
83104
async fn create_snippet(
84105
&self,
85106
Parameters(request): Parameters<CreateSnippetRequest>,
@@ -125,7 +146,9 @@ impl SnippetService {
125146
}
126147
}
127148

128-
#[tool(description = "Get a code snippet by ID")]
149+
#[tool(
150+
description = "Get a specific code snippet from SeekCode by ID and return complete snippet information"
151+
)]
129152
async fn get_snippet(
130153
&self,
131154
Parameters(request): Parameters<IdRequest>,
@@ -173,7 +196,9 @@ impl SnippetService {
173196
}
174197
}
175198

176-
#[tool(description = "Search code snippets")]
199+
#[tool(
200+
description = "Search code snippets in SeekCode with keyword search, language filtering and tag filtering"
201+
)]
177202
async fn search_snippets(
178203
&self,
179204
Parameters(request): Parameters<SearchSnippetRequest>,
@@ -351,7 +376,9 @@ impl SnippetService {
351376
// }
352377
// }
353378

354-
#[tool(description = "List all code snippets with pagination")]
379+
#[tool(
380+
description = "List all code snippets from SeekCode with pagination, supporting custom page number and items per page"
381+
)]
355382
async fn list_snippets(
356383
&self,
357384
Parameters(request): Parameters<ListRequest>,
@@ -433,7 +460,7 @@ impl ServerHandler for SnippetService {
433460
.enable_tools()
434461
.build(),
435462
server_info: Implementation::from_build_env(),
436-
instructions: Some("This server provides code snippet management tools. You can create, read, update, delete, search and list code snippets.".to_string()),
463+
instructions: Some("This is the SeekCode MCP server that provides code snippet management features:\n1. Create code snippets in SeekCode - supports title, code content, programming language and tags\n2. Query code snippets from SeekCode - get specific snippets by ID\n3. Search code snippets in SeekCode - supports keyword search, language and tag filtering\n4. List code snippets from SeekCode - supports pagination display\n\nAll tools support detailed parameter descriptions for better understanding and usage.".to_string()),
437464
}
438465
}
439466

src/components/McpServer.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ const getMcpJson = () => {
355355
type: "http",
356356
},
357357
},
358-
inputs: [],
359358
};
360359
return JSON.stringify(mcpJsonConfig, null, 2);
361360
};

0 commit comments

Comments
 (0)