atlas-mcp-server
Version:
ATLAS (Adaptive Task & Logic Automation System): An MCP server enabling LLM agents to manage projects, tasks, and knowledge via a Neo4j-backed, three-tier architecture. Facilitates complex workflow automation and project management through LLM Agents.
38 lines (37 loc) • 1.76 kB
JavaScript
import { createToolResponse } from "../../../types/mcp.js"; // Import the new response creator
/**
* Formatter for database clean operation responses
*/
export class DatabaseCleanFormatter {
format(data) {
// Destructure without 'details' as it's no longer part of the interface or provided by the implementation
const { success, message, timestamp } = data;
// Create a summary section with operation results
const summaryHeader = success
? "Database Reset Successfully"
: "Database Reset Failed";
const summary = `${summaryHeader}\n\n` +
`Status: ${success ? "✅ Success" : "❌ Failed"}\n` +
`Message: ${message}\n` +
`Timestamp: ${new Date(timestamp).toLocaleString()}\n`;
// Removed the 'detailsSection' as the implementation doesn't provide these details
// Add warning about permanent data loss
const warning = "\n⚠️ WARNING\n" +
"This operation has permanently removed all data from the database. " +
"This action cannot be undone. If you need to restore the data, you must use a backup.";
// Return summary and warning only
return `${summary}${warning}`;
}
}
/**
* Create a formatted, human-readable response for the atlas_database_clean tool
*
* @param data The raw database clean response data
* @param isError Whether this response represents an error condition
* @returns Formatted MCP tool response with appropriate structure
*/
export function formatDatabaseCleanResponse(data, isError = false) {
const formatter = new DatabaseCleanFormatter();
const formattedText = formatter.format(data);
return createToolResponse(formattedText, isError);
}