// src/mcp/utils/result-adapter.ts
function resultToMcpResponse(result) {
  if (result.ok) {
    return {
      content: [
        {
          type: "text",
          text: typeof result.value === "string" ? result.value : JSON.stringify(result.value)
        }
      ]
    };
  }
  return {
    content: [{ type: "text", text: result.error.message }],
    isError: true
  };
}

export {
  resultToMcpResponse
};
