Files
mcp-memory/server/src/tools.rs
T

275 lines
8.0 KiB
Rust

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct CreateEntitiesTool {
pub entities: Vec<serde_json::Value>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct CreateRelationsTool {
pub relations: Vec<serde_json::Value>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct AddObservationsTool {
pub observations: Vec<serde_json::Value>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct DeleteEntitiesTool {
#[serde(rename = "entityNames")]
pub entity_names: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct DeleteObservationsTool {
pub deletions: Vec<serde_json::Value>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct DeleteRelationsTool {
pub relations: Vec<serde_json::Value>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadGraphTool {
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SearchNodesTool {
pub query: String,
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct OpenNodesTool {
pub names: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LogCodeChangeTool {
#[serde(rename = "filePath")]
pub file_path: String,
pub description: String,
pub git_commit: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct QueryRecentChangesTool {}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct VisualizeGraphTool {
pub query: Option<String>,
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct AddStickyNoteTool {
pub content: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadStickyNotesTool {}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct CondenseEntityTool {
#[serde(rename = "entityName")]
pub entity_name: String,
pub summarized_observations: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct AddTaskTool {
pub title: String,
pub description: String,
pub git_branch: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct UpdateTaskStatusTool {
pub id: String,
pub status: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListActiveTasksTool { pub git_branch: Option<String>, }
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct StoreSnippetTool {
pub name: String,
pub language: String,
pub code: String,
pub description: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SearchSnippetsTool {
pub query: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct DeleteSnippetTool {
pub name: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LogDecisionTool {
pub title: String,
pub context: String,
pub decision: String,
pub consequence: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct QueryDecisionsTool {
pub query: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct MergeEntitiesTool {
#[serde(rename = "sourceEntity")]
pub source_entity: String,
#[serde(rename = "targetEntity")]
pub target_entity: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct FindOrphansTool {}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LearnPreferenceTool {
pub key: String,
pub value: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadPreferencesTool {}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LogErrorFixTool {
pub signature: String,
pub solution: String,
pub git_commit: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SearchErrorFixesTool {
pub query: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct PinFileTool {
pub namespace: String,
pub file_path: String,
pub git_branch: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct UnpinFileTool {
pub namespace: String,
pub file_path: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListPinnedFilesTool {
pub namespace: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct AddSessionSummaryTool {
pub summary: String,
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct GetProjectTimelineTool {
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LeaveHandoffMemoTool {
pub content: String,
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadHandoffMemosTool {
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ClearHandoffMemosTool {
pub ids: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct UpdateEnvFingerprintTool {
pub namespace: String,
pub tool_versions: std::collections::HashMap<String, String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadEnvFingerprintTool {
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LogEnvRequirementTool {
pub namespace: String,
pub key: String,
pub description: String,
pub is_secret: bool,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct AddMilestoneTool {
pub title: String,
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct UpdateMilestoneTool {
pub id: String,
pub status: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListMilestonesTool {
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct GenerateStandupReportTool {
pub namespace: String,
pub hours_lookback: u64,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct RegisterEnvironmentTool {
pub namespace: String,
pub name: String,
pub url: String,
pub description: String,
pub requires_vpn: bool,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct GetEnvironmentDetailsTool {
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct AddPrChecklistItemTool {
pub namespace: String,
pub description: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct GetPrChecklistTool {
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ClearPrChecklistTool {
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LogTechDebtTool {
pub namespace: String,
pub description: String,
pub ideal_solution: String,
pub git_commit: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ResolveTechDebtTool {
pub id: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListTechDebtTool {
pub namespace: String,
pub include_resolved: bool,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SaveContextWorkspaceTool {
pub namespace: String,
pub name: String,
pub pinned_files: Vec<String>,
pub active_task_ids: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LoadContextWorkspaceTool {
pub namespace: String,
pub name: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListContextWorkspacesTool {
pub namespace: String,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct OmniSearchTool {
pub query: String,
pub namespace: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct GetProjectHealthTool {
pub namespace: String,
}