import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import { api } from "../api/client.js";
import { formatResponse } from "../utils/index.js";
export function registerDebugTools(server: McpServer) {
// Test if MCP server is working
server.tool("debug_test", "Test if MCP server is working", {}, async () => {
try {
// Try to make a simple API call to test connectivity
const response = await api.get("/projects/list-of-boards");
const result = {
status: "success",
message: "MCP server is working correctly",
api_status: "connected",
timestamp: new Date().toISOString(),
boards_count: response.data.boards ? response.data.boards.length : 0,
};
return formatResponse(result);
} catch (error: any) {
const result = {
status: "error",
message: "MCP server test failed",
error: error.message,
timestamp: new Date().toISOString(),
};
return formatResponse(result);
}
});
}