docs: update human and LLM docs and enhance tool/list schemas with actionable next steps
This commit is contained in:
1 parent
961abb01e7
commit
4b307b55b9
12 files changed
+307
-336
No files matched your search
@@ -496,13 +496,13 @@ impl McpTool for PinnedFilesHandler {
|
||||
match req.action {
|
||||
PinnedFileAction::Pin => {
|
||||
let path = req.path.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("path is required for 'pin' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'path' for action 'pin'. Next step: Provide absolute or relative file 'path' in request and retry.".to_string())
|
||||
})?;
|
||||
PinFileHandler.execute(serde_json::json!({"file_path": path, "namespace": ns}), state).await
|
||||
}
|
||||
PinnedFileAction::Unpin => {
|
||||
let path = req.path.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("path is required for 'unpin' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'path' for action 'unpin'. Next step: Provide file 'path' in request and retry.".to_string())
|
||||
})?;
|
||||
UnpinFileHandler.execute(serde_json::json!({"file_path": path, "namespace": ns}), state).await
|
||||
}
|
||||
@@ -534,7 +534,7 @@ impl McpTool for ContextWorkspacesHandler {
|
||||
match req.action {
|
||||
ContextWorkspaceAction::Save => {
|
||||
let name = req.name.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("name is required for 'save' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'name' for action 'save'. Next step: Provide workspace 'name' string in request and retry.".to_string())
|
||||
})?;
|
||||
let pinned_files = req.pinned_files.unwrap_or_default();
|
||||
let active_task_ids = req.active_task_ids.unwrap_or_default();
|
||||
@@ -550,7 +550,7 @@ impl McpTool for ContextWorkspacesHandler {
|
||||
}
|
||||
ContextWorkspaceAction::Load => {
|
||||
let name = req.name.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("name is required for 'load' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'name' for action 'load'. Next step: Provide workspace 'name' string in request and retry.".to_string())
|
||||
})?;
|
||||
LoadContextWorkspaceHandler.execute(serde_json::json!({"name": name, "namespace": ns}), state).await
|
||||
}
|
||||
@@ -559,16 +559,16 @@ impl McpTool for ContextWorkspacesHandler {
|
||||
}
|
||||
ContextWorkspaceAction::Delete => {
|
||||
let name = req.name.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("name is required for 'delete' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'name' for action 'delete'. Next step: Provide workspace 'name' string in request and retry.".to_string())
|
||||
})?;
|
||||
DeleteContextWorkspaceHandler.execute(serde_json::json!({"name": name, "namespace": ns}), state).await
|
||||
}
|
||||
ContextWorkspaceAction::Diff => {
|
||||
let name = req.name.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("name is required for 'diff' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'name' for action 'diff'. Next step: Provide primary workspace 'name' in request and retry.".to_string())
|
||||
})?;
|
||||
let other = req.other_name.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("other_name is required for 'diff' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'other_name' for action 'diff'. Next step: Provide secondary workspace 'other_name' in request and retry.".to_string())
|
||||
})?;
|
||||
DiffContextWorkspacesHandler.execute(serde_json::json!({"workspace_a": name, "workspace_b": other, "namespace": ns}), state).await
|
||||
}
|
||||
@@ -597,7 +597,7 @@ impl McpTool for PrChecklistHandler {
|
||||
match req.action {
|
||||
PrChecklistAction::Add => {
|
||||
let desc = req.description.ok_or_else(|| {
|
||||
crate::error::AppError::Internal("description is required for 'add' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'description' for action 'add'. Next step: Provide checklist item 'description' string in request and retry.".to_string())
|
||||
})?;
|
||||
AddPrChecklistItemHandler.execute(serde_json::json!({"description": desc, "namespace": ns}), state).await
|
||||
}
|
||||
@@ -631,7 +631,7 @@ impl McpTool for SnippetsHandler {
|
||||
match req.action {
|
||||
SnippetAction::Store => {
|
||||
let name = req.query.or(req.id).ok_or_else(|| {
|
||||
crate::error::AppError::Internal("name is required for 'store' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'query' or 'id' as snippet name for action 'store'. Next step: Provide snippet name in 'query' field and retry.".to_string())
|
||||
})?;
|
||||
let lang = req.language.unwrap_or_else(|| "text".to_string());
|
||||
let code = req.code.unwrap_or_default();
|
||||
@@ -657,13 +657,13 @@ impl McpTool for SnippetsHandler {
|
||||
}
|
||||
SnippetAction::Delete => {
|
||||
let id = req.id.or(req.query).ok_or_else(|| {
|
||||
crate::error::AppError::Internal("id/name is required for 'delete' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'id' or 'query' for action 'delete'. Next step: Provide snippet ID/name in request and retry.".to_string())
|
||||
})?;
|
||||
DeleteSnippetHandler.execute(serde_json::json!({"name": id}), state).await
|
||||
}
|
||||
SnippetAction::Tag => {
|
||||
let id = req.id.or(req.query).ok_or_else(|| {
|
||||
crate::error::AppError::Internal("id/name is required for 'tag' action".to_string())
|
||||
crate::error::AppError::Internal("Missing required parameter 'id' or 'query' for action 'tag'. Next step: Provide snippet ID/name and 'tags' array in request and retry.".to_string())
|
||||
})?;
|
||||
let tags = req.tags.unwrap_or_default();
|
||||
TagSnippetHandler.execute(serde_json::json!({"name": id, "tags": tags}), state).await
|
||||
|
||||
Reference in new issue
Block a user